【发布时间】:2010-11-27 06:31:57
【问题描述】:
我放在 mytheme template.php 中的代码
function mytheme_theme(){
return array(
'mytheme_example' => 'example',
'argument' => array('myvar' => null),
);
}
我放在 node.tpl.php 中的代码
<?php
$html = "";
$myvar = "hello,world";
$html .= theme('mytheme_example', myvar);
return $html;
?>
我放入 example.tpl.php 的代码
<div>
here is the <b><?php print myvar; ?></b>being created.
</div>
我已经清除了缓存,但是在节点文章的页面上,没有任何关于hello world的输出。
ps:哪些文件我可以使用 hook_theme、template.php、模块文件。有没有我可以使用这个钩子的文件?
【问题讨论】: