Marcus
Well-known member
I want to pass a simple variable $testVar to a template but {$testVar} does not work in both templates my_header, body. Here is my code:
public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
switch($hookName)
{
case 'body':
{
$myParams = array(
'testVar' => 'test',
);
$contents = $template->create('my_header', array_merge($myParams, $template->getParams())) . $contents;
break;
}
}
}