【问题标题】:How to use html edit character (✎) instead of directly use "edit" in cakephp?如何使用html编辑字符(✎)而不是直接在cakephp中使用“编辑”?
【发布时间】:2016-07-12 04:47:55
【问题描述】:

我有这个链接

<?= $this->Html->link(__('Edit'), ['action' => 'edit', $o->id]) ?>. 

我想使用编辑 html 字符 (✎) 而不是 Edit

请帮忙。

【问题讨论】:

    标签: php html cakephp-3.0


    【解决方案1】:

    使用此代码

    &#x270E;
    

    而不是编辑文本

    会产生✎图标

    【讨论】:

      【解决方案2】:

      只需添加“escape”参数并将其设置为false即可。

      你可能想参考这个:CakePHP 3 creating links

      <?php 
           echo Html->link(__('&#x270E;'), 
               ['action' => 'edit', $o->id],
               ['escape' => false]
       ) ?>
      

      【讨论】:

      • 但是对于这个帖子链接不起作用这个。 = $this->Form->postLink('❎', ['action' => 'delete', $o->id], ['confirm' => __('你确定要删除 # {0}?', $o->id)],['escape' => false]); ?>
      • 您已经声明了两个不同的数组用于确认和转义。请将“确认”和“转义”放在同一个数组中。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-27
      • 2012-04-14
      • 1970-01-01
      • 1970-01-01
      • 2012-08-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多