zoukankan      html  css  js  c++  java
  • theme函数小分析

    1 如果模块没有全部加载完成, 则不继续执行
    2 获得所有的themeRegistry数组
    3 一翻处理之后获得THEMEinfo ARRAY
    4 global $theme_path 或许被改变了 当hook_theme是在.module文件定义的 $theme_path被改成成module所在的路径
    5 加载要包含的文件
    6 生成新的$variables 要不就是把原有的#下标变成真的下标并组成一个$variables数组 要不就是生成$variables[$info['render element']]的变量但变量值还是$variables
    7 新生成的$variable和原有的$variable合并
    8 base hook的事情先就不看了
    9 运行THEMEinfo ARRAY里面的process function 和 preprocess function, 进一步改变$variables
    10 检查是否被preprocess/process function添加了新的theme hook suggestion从而提供给了新的THEMEinfo ARRAY
    11 到现在就分2种情况, 一种是运行THEMEinfo ARRAY的function 或者 加载 THEMEinfo ARRAY的template 文件

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

    或者

    function theme_render_template($template_file, $variables) {
      extract($variables, EXTR_SKIP);
      // Start output buffering
      ob_start();
      // Include the template file
      include DRUPAL_ROOT . '/' . $template_file;
      // End buffering and return its contents
      return ob_get_clean();
    }
    

      

  • 相关阅读:
    【PostgreSQL-9.6.3】触发器概述(普通触发器)
    【MySQL】二进制分发安装
    【MySQL】RPM包安装
    【PostgreSQL-9.6.3】分区表
    【PL/SQL】用星号拼出金字塔
    【PostgreSQL-9.6.3】临时表
    【PL/SQL】触发器示例:记录加薪
    【PL/SQL】九九乘法口诀表
    数据结构和算法
    类元编程
  • 原文地址:https://www.cnblogs.com/qinqiu/p/5020053.html
Copyright © 2011-2022 走看看