• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How to use a template for a $variable?

Marcus

Well-known member
#1
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 !