XF 2.1 Render text with line breaks


New member

In a template I want to output a multi-line text that contains line breaks. {$mytext} obviously won't work. I could use {{bb_code($mytext, ...)}}, but actually the text does not contain BBCode - or let's phrase it this way: If it contains BBCode, it was not intented and therefore it should be rendered as is. So basically I need something that does not much more than the PHP function nl2br.
Does xenForo have a suitable built-in function for usage in templates? Or do I need to implement it myself (which seems quite easy)?

Last edited: