如何从html帮助器返回html解码文本? cakephp 3.x

时间:2022-06-23 07:00:40

I am use this.

我用这个。

echo  html_entity_decode(
      $this->Form->postLink( '<i class="fa fa-fw fa-remove"></i>Delete',
                             ['action' => "delete",$item->id],
                             ['confirm' => 'Are you sure?'])
      );

No problems here but I want to don't use html_entity_decode. Do you have another solution?

这里没问题,但我不想使用html_entity_decode。你有其他解决方案吗?

echo     $this->Form->postLink( '<i class="fa fa-fw fa-remove"></i>Delete',
                                 ['action' => "delete",$item->id],
                                 ['confirm' => 'Are you sure?']);

Result: <i class="fa fa-fw fa-remove"></i>Delete

结果: 删除

1 个解决方案

#1


echo     $this->Form->postLink( '<i class="fa fa-fw fa-remove"></i>Delete',
                             ['action' => "delete",$item->id],
                             ['confirm' => 'Are you sure?','escape'=>false]);

You could correct with this params

你可以纠正这个参数

#1


echo     $this->Form->postLink( '<i class="fa fa-fw fa-remove"></i>Delete',
                             ['action' => "delete",$item->id],
                             ['confirm' => 'Are you sure?','escape'=>false]);

You could correct with this params

你可以纠正这个参数