How does the theme (' Item-list ', Array (' Items ' =>array (' aaa ', ' BBB ')) work?

Source: Internet
Author: User

$items [' items '] = Array (    l (' Configure ', ' admin/config '),    L (' Structure ', ' admin/structure '),); $theme =  Theme (' Item_list ', $items);

1, judging if all the modules are loaded,

if (!module_load_all (NULL) &&! defined (' Maintenance_mode ')) {    thrownewException(t (' theme () May is called until all modules is loaded. ') ));  }

2, get all the themeregistry information, this information is the Hook_theme array of all module definitions, and merge many default information, such as process function, function, render array, variables , etc

$hooks = theme_get_registry (FALSE);

3, get the themeregistry information corresponding to this Themehook

$info $hooks [$hook];

4, if Hook_theme defines the includes, then load the function

if (! Empty ($info[' includes '])) {    foreach ($infoas$include _file) {      include_once  $include _file;    }  }

5, $variable and themeregistry correspond to the variable merger of this hook.

  if (! Empty ($info[' variables '])) {    $variables$info[' variables '];  }

6, $info inside process preprocess function is called

$processor _function ($variables$hook _clone);

7, if $variable[' theme_hook_suggestion ' is changed in the process preprocess function, it will reload $hook

$info $hooks [$suggestion];

8, the function inside the $info will be transferred to handle $variable

$output $info [' function '] ($variables);

How does the theme (' Item-list ', Array (' Items ' =>array (' aaa ', ' BBB ')) work?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.