标签:style http color 使用 strong io
自定义的模块名字 预处理 通过hook_theme 声明的主题
2 使用
<?php
//设置变量
function custommodule_preprocess_custom_theme_name(&$variables) {
// Add a custom variables
$variables['custom_var'] = 'i am a custom variable';
}
//在你的主题模版中使用变量
echo $custom_var;
或者
echo $variables['custom_var'];
?>
notice
【theme hook name】使用 函数(theme_get_registry()) 查看当前系统中有多少注册的主题
custom_module_name_preprocess_node
custom_module_name_preprocess_breadcrumb
custom_module_name_preprocess_page
custom_module_name_preprocess_comment
drupal7 使用(hook_preprocess_HOOK)向各个主题模版里面传递变量,布布扣,bubuko.com
drupal7 使用(hook_preprocess_HOOK)向各个主题模版里面传递变量
标签:style http color 使用 strong io
原文地址:http://blog.csdn.net/wjc19911118/article/details/37765891