我想编辑我的php模板,但我做不到。我使用Smarty模板引擎。
我默认的php行如下所示:
{$childItem->getLabel()}它确实显示如下HTML:
MY TEXT <br><span class="text-domain">TEXT</span>我想删除<br>之后的所有内容。所以它只显示MY TEXT部件。
我试过了,但那不管用:
{$childItem->getLabel()|replace:'<br>' : ''}我怎么才能解决这个问题?
发布于 2016-06-22 09:40:51
使用stristr函数
{$childItem->getLabel()|stristr:'<br>' : true}https://stackoverflow.com/questions/37964118
复制相似问题