我需要一些帮助,在CakePHP中3.表单助手创建postLink正常postLink工作得很好这样的:确认消息图标
<?= $this->Form->postLink(__('Delete'),
['action' => 'delete', $member->id],
['confirm' => __('Are you sure, you want to delete {0}?', $member->name)]) ?>
但是当我尝试使用字体 - 真棒图标/ i-tag而不是文本链接,确认消息不再显示。图标本身显示正确,并且动作仍然正常,只是消息不起作用。
我用来帮助以下职位,但在答案的例子有没有工作对我来说:
CakePHP equivalent of html code
我尝试这两种方法:
<?= $this->Form->postLink('<i class="fa fa-trash"></i> ',
['action' => 'delete', $member->id],
['escape' => false],
['confirm' => __('Are you sure, you want to delete {0}?', $member->name)]) ?>
<?= $this->Form->postLink(
$this->Html->tag('i', '', ['class' => 'fa fa-trash']),
['action' => 'edit', $member->id],
['escape' => false],
['confirm' => __('Are you sure you want to delete {0}?', $member->name)]); ?>
我对CakePHP仍然很陌生,并试图在本书中查找,但这对我没有帮助。我也尝试了上面的SO链接中显示的确切语法,它似乎为其他人工作...但确认消息仍然不适用于我。
我在这里做错了什么?
可能重复http://stackoverflow.com/questions/29703597/ cakephp-3-0-bootstrap-glyphicons) – ndm
谢谢,是的。如果我找到答案,那个问题的答案会帮助我...。但标题和标签有点误导,因为这个问题不是(仅)关于图标问题。我认为在这里建立一个确认信息问题的连接并不容易。 – eve