本文介绍了如何创建图标里面的形式postlink与cakephp和twitter bootstrap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这给了我想要的:

<?php echo $this->Html->link(
   $this->Html->tag('i', '', array('class' => 'glyphicon glyphicon-edit')) . " Edit",
   array('action' => 'edit', $comment['Comment']['comment_id']),
   array('class' => 'btn btn-mini', 'escape' => false)
); ?>

但是当我创建一个Form postLink我不知道如何获取删除图标

But when I create a Form postLink I don't know how to get the remove icon in front of it..

<?php echo $this->Form->postLink(
   $this->Html->tag('i', '', array('class' => 'glyphicon glyphicon-remove')) . " Delete",
   array('action' => 'delete', $comment['Comment']['comment_id']), null, __('Are you sure you want to delete # %s?', $comment['Comment']['comment_id']),
   array('class' => 'btn btn-mini', 'escape' => false)
); ?>

它给我< i class =glyphicon glyphicon-remove> ;< / i>删除

推荐答案

您忘记了添加选项 escape false

echo $this->Form->postLink(
   $this->Html->tag('i', '', array('class' => 'glyphicon glyphicon-remove')). " Delete",
        array('action' => 'delete', $comment['Comment']['comment_id']),
        array('escape'=>false),
    __('Are you sure you want to delete # %s?', $comment['Comment']['comment_id']),
   array('class' => 'btn btn-mini')
);

这篇关于如何创建图标里面的形式postlink与cakephp和twitter bootstrap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 15:50