cakephp图片链接在行动删除

时间:2015-04-07 21:09:45

标签: cakephp croogo

我很抱歉英语不好:)

我想在删除链接中显示图像,我已经使用了这段代码,但它无法正常工作

$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));

在行动editadd中,下面给出的代码可以正常运行:

$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?')

1 个答案:

答案 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)
);