Henk Z Henk Z - 1 year ago 47
Smarty Question

Edit php line Smarty template engine

I want to edit my php template, but I can not get it right.
I use the the Smarty template engine.

My default php line looks like this:


That does display HTML like this:

MY TEXT <br><span class="text-domain">TEXT</span>

I want to remove all content after the
. So that it only displays the

I tried this, but that does not work:

{$childItem->getLabel()|replace:'<br>' : ''}

How can I fix this?

Answer Source

use stristr function

{$childItem->getLabel()|stristr:'<br>' : true}