Ali*_*rim 0 cakephp twitter-bootstrap
我正在尝试删除删除按钮名称并尝试在此处添加图标。我已成功添加,通过此代码编辑图标
<a href="/cakeauth/users/edit/<?php echo $user['User']['id'];?>" class="btn btn-sm btn-warning">
<span class="glyphicon glyphicon-edit"></span>
</a>
Run Code Online (Sandbox Code Playgroud)
现在在这个删除按钮中我如何添加引导程序图标?
echo $this->Form->postLink(__('Delete'),
array('action' => 'delete', $user['User']['id']),
array(), __('Are you sure you want to delete # %s?', $user['User']['id']));
Run Code Online (Sandbox Code Playgroud)
请添加以下行
array('esacpe',false)
Run Code Online (Sandbox Code Playgroud)
或者
你应该试试这个代码。
echo $this->Form->postLink(
$this->Html->tag('i', '', array('class' => 'glyphicon glyphicon-remove')). " Delete",
array('action' => 'delete', $user['User']['id']),
array('escape'=>false),
__('Are you sure you want to delete # %s?', $user['User']['id']),
array('class' => 'btn btn-mini')
);
Run Code Online (Sandbox Code Playgroud)
请参考以下链接:
如何使用cakephp和twitter bootstrap在表单postlink中创建图标