XF 2.0 Parsing BBCode in a template

adamsmasher

Active member
In XF 1.x you could use something like this to parse BBCode in a template:

Code:
{xf:helper bbCode, $parser, $someVar.index}

Is there something similar in XF 2.x? I saw some methods digging through classes but didn't see a 1:1 comparison. I'm sure I'm just missing it (really need to learn an IDE instead of using Coda and searching files through the mac OS Finder...). I've got a string that includes BBCode that I want to parse as HTML within the string. I can strip it out, but in this template I want it to actually render as HTML.
 
I tried that but got this: Function bbcode is unknown (src/XF/Template/Templater.php:762)

Is that not available for templates normally?
 
Seems like I need to pass more arguments to it: Missing argument 4 for XF\Template\Templater::fnBbCode() (src/XF/Template/Templater.php:1717)

Code:
$templater, &$escape, $bbCode, $context, $user = null, array $options = [], $type = 'html'

Since this is a custom page I added "page" for context and it works, e.g. {{ bb_code($myVar.index, "page") }}

Thanks for your help, by the way. :)
 
Back
Top Bottom