chg: [genericTemplates:toggle] Added support of confirm modal
parent
5175564c47
commit
c43772315a
|
@ -1 +1,14 @@
|
||||||
<?= $this->Form->postLink(__('Toggle'), ['action' => 'toggle', $entity->id, $fieldName], ['confirm' => __('Are you sure you want to toggle {0} of {1}?', $fieldName. $entity->id)]) ?>
|
<?php
|
||||||
|
|
||||||
|
$form = $this->Form->postLink(__('Toggle'), ['action' => 'toggle', $entity->id, $fieldName], ['confirm' => __('Are you sure you want to toggle `{0}` of {1}?', h($fieldName), h($entity->id))]);
|
||||||
|
$formHTML = sprintf('<div class="d-none">%s</div>', $form);
|
||||||
|
$bodyHTML = $formHTML;
|
||||||
|
|
||||||
|
$modalOptions = [
|
||||||
|
'title' => __('Are you sure you want to toggle `{0}` of {1}?', h($fieldName), h($entity->id)),
|
||||||
|
'type' => 'confirm',
|
||||||
|
'bodyHtml' => $bodyHTML,
|
||||||
|
];
|
||||||
|
|
||||||
|
echo $this->Bootstrap->modal($modalOptions);
|
||||||
|
?>
|
Loading…
Reference in New Issue