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();
    }
    

      

  • 相关阅读:
    13 数据库主从
    12 数据备份
    11 锁机制
    12 日志
    10 索引(二)
    09 索引
    update kernel 3.10-3.12
    haproxy para config
    mysql slave to master
    storage disk
  • 原文地址:https://www.cnblogs.com/qinqiu/p/5020053.html
Copyright © 2011-2022 走看看