Skip to content

Commit

Permalink
Add the possibility to use additional template vars for submitContainer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Dec 24, 2015
1 parent 5be4156 commit 1498886
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/View/Helper/FormHelper.php
Expand Up @@ -1722,7 +1722,11 @@ public function submit($caption = null, array $options = [])
if (!is_string($caption) && empty($caption)) {
$caption = __d('cake', 'Submit');
}
$options += ['type' => 'submit', 'secure' => false];
$options += [
'type' => 'submit',
'secure' => false,
'templateVars' => []
];

if (isset($options['name'])) {
$this->_secure($options['secure'], $this->_secureFieldName($options['name']));
Expand Down Expand Up @@ -1765,11 +1769,12 @@ public function submit($caption = null, array $options = [])

$input = $this->formatTemplate('inputSubmit', [
'type' => $type,
'attrs' => $this->templater()->formatAttributes($options),
'attrs' => $this->templater()->formatAttributes($options)
]);

return $this->formatTemplate('submitContainer', [
'content' => $input
'content' => $input,
'templateVars' => $options['templateVars']
]);
}

Expand Down

0 comments on commit 1498886

Please sign in to comment.