如何向此代码添加类?
$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']
)
关于javascript - CakePHP 3.0 - 发布链接 - 添加类删除警报确认功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42833291/