How to use a template for a $variable?

Marcus

Well-known member
In a class I want to make the $message variable more beautiful, so I want to use a "custom_template" to style the variable. Template custom_template:
PHP:
<h1>Message</h1>
{$message}

My code would be
PHP:
$viewParams = array('message' = $message);
$message = XenForo_Template('custom_template', $viewParams);

Do you know how I could get the code working? The class is within event notice_fire, so I do not have access to any parent class. Thank you !
 
Back
Top Bottom