[英]CakePHP 3.0 - Post Link - adding a class removes alert confirmation functionality
如何为该代码添加类?
$this->Form->postLink(
__('Delete'),
['action' => 'delete', $user->id],
['confirm' => __('Are you sure you want to delete # {0}?', $user->id)]
)
当我添加一个类时,“确认功能”消失了。
$this->Form->postLink(
__('Delete'),
['action' => 'delete', $user->id],
['class' => 'btn btn-danger'],
['confirm' => __('Are you sure you want to delete # {0}?', $user->id)]
)
confirm
和class
应该在同一数组中
$this->Form->postLink(
__('Delete'),
['action' => 'delete', $user->id],
['confirm' => __('Are you sure you want to delete # {0}?', $user->id),'class'=>'btn btn-danger']
)
确认之前设置课程
['class' => 'btn btn-danger','confirm' => __('Are you sure you want to delete # {0}?', $user->id)]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.