Мне нужно знать самый простой способ передачи переменной из пользовательского модуля в его шаблон.
Я создал custom.module и поместил custom.tpl.php в папку модуля
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);
}
iЯ добавил функцию темы, но она не работает, кто-нибудь может подсказать, что не так с этим кодом
function theme_custom($arg) {
return $arg['output'];
}
function custom_theme() {
return array(
'Bluemarine' => array(
'variables' => 'output',
'template' => 'Bluemarine',
),
);
}