我如何 html 解码从 html 助手返回的文本? cakephp 3.x
How can i do html decode text returning from html helper? cakephp 3.x
我正在用这个。
echo html_entity_decode(
$this->Form->postLink( '<i class="fa fa-fw fa-remove"></i>Delete',
['action' => "delete",$item->id],
['confirm' => 'Are you sure?'])
);
这里没有问题,但我不想使用 html_entity_decode。您还有其他解决方案吗?
echo $this->Form->postLink( '<i class="fa fa-fw fa-remove"></i>Delete',
['action' => "delete",$item->id],
['confirm' => 'Are you sure?']);
结果:<i class="fa fa-fw fa-remove"></i>Delete
echo $this->Form->postLink( '<i class="fa fa-fw fa-remove"></i>Delete',
['action' => "delete",$item->id],
['confirm' => 'Are you sure?','escape'=>false]);
您可以使用此参数进行更正
我正在用这个。
echo html_entity_decode(
$this->Form->postLink( '<i class="fa fa-fw fa-remove"></i>Delete',
['action' => "delete",$item->id],
['confirm' => 'Are you sure?'])
);
这里没有问题,但我不想使用 html_entity_decode。您还有其他解决方案吗?
echo $this->Form->postLink( '<i class="fa fa-fw fa-remove"></i>Delete',
['action' => "delete",$item->id],
['confirm' => 'Are you sure?']);
结果:<i class="fa fa-fw fa-remove"></i>Delete
echo $this->Form->postLink( '<i class="fa fa-fw fa-remove"></i>Delete',
['action' => "delete",$item->id],
['confirm' => 'Are you sure?','escape'=>false]);
您可以使用此参数进行更正