如何在此代码中添加类?
$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)]
)
答案 0 :(得分:1)
class
和$this->Form->postLink(
__('Delete'),
['action' => 'delete', $user->id],
['confirm' => __('Are you sure you want to delete # {0}?', $user->id),'class'=>'btn btn-danger']
)
应位于同一个数组
{{1}}
答案 1 :(得分:0)
确认前设置课程
['class' => 'btn btn-danger','confirm' => __('Are you sure you want to delete # {0}?', $user->id)]