跳转到主要内容
HaiKe 提交于 5 September 2013
structure_customize.module文件 function structure_customize_menu() { // index $items['admin/cmain'] = array( 'title' => 'Main', 'description' => 'Background structure custom modules', 'page callback' => 'structure_customize_cmain', 'access arguments' => array('access content'), 'access callback' => TRUE, 'type' => MENU_CALLBACK, 'file' => 'structure_customize.admin.inc', ); return $items; } /** * Override hook_theme */ function structure_customize_theme() { $themes['structure_customize_cmain_template'] = array( 'arguments' => array(), 'template' => 'chome', 'pattern' => 'chome__', 'render element' => 'page', ); /*$themes['structure_customize_ctheme_template'] = array( 'arguments' => array(), 'variables' => array('with_monkey' => FALSE, 'activations' => array()), 'template' => 'ctheme', 'pattern' => 'ctheme__', );*/ return $themes; } structure_customize.admin.inc文件 function structure_customize_cmain() { return theme('structure_customize_cmain_template'); } chome.tpl.php文件 In Modules <?php print_r($page);?> 访问admin/cmain 显示 Undefined variable:page in include()
Drupal 版本