gpt4 book ai didi

forms - 如何使用 cakephp 和 twitter bootstrap 在 poSTLink 表单中创建图标

转载 作者:行者123 更新时间:2023-12-01 15:00:07 24 4
gpt4 key购买 nike

这给了我想要的:

<?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 时,我不知道如何在它前面获取删除图标..

<?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> Delete

最佳答案

您忘记将选项 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')
);

关于forms - 如何使用 cakephp 和 twitter bootstrap 在 poSTLink 表单中创建图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22995651/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com