From dbfbe221561037695bb660e10d8b2c64f80edc84 Mon Sep 17 00:00:00 2001 From: ADmad Date: Sat, 2 Sep 2017 17:42:38 +0530 Subject: [PATCH] Set value for default "Save" button. Without a value you can't set a redirect reader for it. --- src/Template/Element/form/buttons.ctp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Template/Element/form/buttons.ctp b/src/Template/Element/form/buttons.ctp index e9d74fa4..a5c30af7 100644 --- a/src/Template/Element/form/buttons.ctp +++ b/src/Template/Element/form/buttons.ctp @@ -1,15 +1,17 @@
+ Form->button( + $formSubmitButtonText, + ['class' => 'btn btn-primary', 'name' => '_save', 'value' => '1'] + ) ?> Form->button($formSubmitButtonText, ['class' => 'btn btn-primary', 'name' => '_save']); - - if (!empty($formSubmitExtraButtons)) { - foreach ($formSubmitExtraButtons as $button) { - if ($button['type'] === 'button') { - echo $this->Form->button($button['title'], $button['options']); - } elseif ($button['type'] === 'link') { - echo $this->Html->link($button['title'], $button['url'], $button['options']); - } + if (!empty($formSubmitExtraButtons)) { + foreach ($formSubmitExtraButtons as $button) { + if ($button['type'] === 'button') { + echo $this->Form->button($button['title'], $button['options']); + } elseif ($button['type'] === 'link') { + echo $this->Html->link($button['title'], $button['url'], $button['options']); } } + } ?>