我很抱歉英语不好:)
我想在删除链接中显示图像,我已经使用了这段代码,但它无法正常工作
$actions= $this->Html->link($this->Html->image('/img/supp.png') . ' ' ,array('controller' => 'markets', 'action' => 'delete' , $market['Market']['id'], ), null,('Are you sure?'), array('escape' => false));
在行动edit
和add
中,下面给出的代码可以正常运行:
$actions .= ' ' . $this->Html->link($this->Html->image('/img/edit.png') . ' ' ,array('controller' => 'markets', 'action' => 'edit', $market['Market']['id'], ), array('escape' => false));
我认为问题在于:, null,('Are you sure?')
答案 0 :(得分:0)
您使用的语法错误。请尝试下面的代码片段。
echo $this->Html->link(
$this->Html->image('/img/supp.png'),
array('controller' => 'markets', 'action' => 'delete', $market['Market']['id']),
array('confirm' => 'Are you sure you wish to delete this record?', 'escape' => false)
);