这就是我现在所拥有的。
$this->Form->postLink(
__('Delete Client'),
['action' => 'delete', $client->id],
['confirm' => __('Are you sure you want to delete # {0}?', $client->id)]
)
如何使用options数组将图像添加到此链接?
答案 0 :(得分:1)
$this->Form->postLink(
$this->Html->image(
"action-delete.svg",
["alt" => "Delete Client", 'class' => 'action-link']
),
['controller' => 'clients', 'action' => 'delete', $client->id],
['escape' => false, 'confirm' => __('Are you sure you want to delete # {0}?', $client->id)]
)
答案 1 :(得分:0)
请尝试我的作品完美!
echo $this->Form->postLink($this->Html->image('1.png'), ['action' => 'delete',$client->id],['escape' => false, 'title' => 'Delete', 'confirm' => __('Are you sure you want to delete # {0}?'),$client->id)]);?>
谢谢!