我是Laravel的新手。
我想在删除前显示警告对话框
{{link_to_action('RentsController@delete', 'delete',onclick="return confirm('are you sure delete this?')",array($l->id))}}
但它对我不起作用,有人可以解释一下吗?
答案 0 :(得分:0)
除了你甚至没有传递正确的字符串这一事实外,HTML属性必须是第四个参数和数组:
{{ link_to_action(
'RentsController@delete',
'delete',
null,
array(
'onclick' => "return confirm('are you sure delete this?')",
'id' => $l->id
)
) }}