cclaerhout
Well-known member
My title is not the best one, I know. A simple example will be better. What I'm trying to do in the template hook listener:
I've got different kinds of errors: when xen tags used in $mystring:
Otherwise:
All in "library/XenForo/Template/Abstract.php".
I've also tried with the XenForo_Template_Compiler, but nothing happens.
Is there a way, or to be parsed a xen tag must be in template first and can't be injected after?
PHP:
$mystring ="This is {xen:phrase myphrase}"; //It's just an example, this string is inside the database, I would like to avoid to capture the tag, then use PHP to activate the phrase
$template->setTemplate('MyVirtualTemplate', $mystring);
$templateObject = $template->create('MyVirtualTemplate', array());
//Then I would like to render my Virtual Template, but It doesn't want
$final = $templateObject->render();
I've got different kinds of errors: when xen tags used in $mystring:
Code:
Parse error: syntax error, unexpected ':'
Otherwise:
Code:
Parse error: syntax error, unexpected $end
All in "library/XenForo/Template/Abstract.php".
I've also tried with the XenForo_Template_Compiler, but nothing happens.
Is there a way, or to be parsed a xen tag must be in template first and can't be injected after?