php - CakePHP 3.0 - Post Link - adding classes removes alert confirmation functionality -
when add class array postlink, confirm alert stops working. have moved class array different positions within postlink nothing seems work.
<?= $this->form->postlink(__('delete'), ['controller' => '<%= $details['controller'] %>', 'action' => 'delete', <%= $otherpk %>], ['class' => 'btn btn-danger btn-sm'], ['confirm' => __('are sure want delete # {0}?', <%= $otherpk %>)]) %>
the above code add right classes link, confirmation doesn't work, deletes entry right away.
the confirm
message , other html options class
go in same array
<?= $this->form->postlink(__('delete'), ['controller' => '<%= $details['controller'] %>', 'action' => 'delete', <%= $otherpk %>], ['class' => 'btn btn-danger btn-sm'],'confirm' => __('are sure want delete # {0}?', <%= $otherpk %>)]) %>
Comments
Post a Comment