Skip to content

Commit

Permalink
Set value for default "Save" button.
Browse files Browse the repository at this point in the history
Without a value you can't set a redirect reader for it.
  • Loading branch information
ADmad committed Sep 2, 2017
1 parent 7a53156 commit dbfbe22
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/Template/Element/form/buttons.ctp
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<div class="col pull-right">
<?= $this->Form->button(
$formSubmitButtonText,
['class' => 'btn btn-primary', 'name' => '_save', 'value' => '1']
) ?>
<?php
echo $this->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']);
}
}
}
?>
</div>

0 comments on commit dbfbe22

Please sign in to comment.