2
如何将变量从自定义模块传递到其模板文件?
我需要知道将变量从定制模块传递到其模板文件的最简单方法。我已经创建了custom.module并将custom.tpl.php放置在module文件夹中。 function custom_menu(){ $items = array(); $items['custom'] = array( 'title' => t('custom!'), 'page callback' => 'custom_page', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); return $items; } function custom_page() { $setVar = 'this is custom module'; return theme('custom', $setVar); } 我添加了主题功能,但无法正常工作,有人可以建议我这段代码有什么问题吗 function theme_custom($arg) { return $arg['output']; } function custom_theme() …
8
theming