Ответ 1
Попробуйте добавить массив variables
в hook_theme
function mytheme_theme($existing, $type, $theme, $path){
return array(
'mytheme_header' => array(
'template' => 'header',
'path' => $path . '/templates',
'type' => 'theme',
'variables' => array(
'title' => NULL,
'some_text' => NULL,
),
),
);
}
В вашем файле header.tpl.php
:
<h1><?php print $title; ?></h1>
<p><?php print $some_text; ?></p>
Затем напечатайте это следующим образом:
$vars = array();
$vars['title'] = "This is a title";
$vars['some_text'] = "Some text...";
print theme('mytheme_header', $vars);