Skip to content

Commit

Permalink
Reformat and use short array syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 4, 2014
1 parent 8543478 commit c60f3fb
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/View/Helper/FormHelper.php
Expand Up @@ -1463,8 +1463,6 @@ public function postLink($title, $url = null, $options = array(), $confirmMessag
*
* ### Options
*
* - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to
* FormHelper::input().
* - `type` - Set to 'reset' for reset inputs. Defaults to 'submit'
* - Other attributes will be assigned to the input element.
*
Expand All @@ -1476,11 +1474,11 @@ public function postLink($title, $url = null, $options = array(), $confirmMessag
* @return string A HTML submit button
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::submit
*/
public function submit($caption = null, $options = array()) {
public function submit($caption = null, $options = []) {
if (!is_string($caption) && empty($caption)) {
$caption = __d('cake', 'Submit');
}
$options += array('type' => 'submit', 'secure' => false);
$options += ['type' => 'submit', 'secure' => false];

if (isset($options['name'])) {
$this->_secure($options['secure'], $this->_secureFieldName($options));
Expand All @@ -1496,9 +1494,10 @@ public function submit($caption = null, $options = array()) {
if ($isUrl || $isImage) {
$unlockFields = array('x', 'y');
if (isset($options['name'])) {
$unlockFields = array(
$options['name'] . '_x', $options['name'] . '_y'
);
$unlockFields = [
$options['name'] . '_x',
$options['name'] . '_y'
];
}
foreach ($unlockFields as $ignore) {
$this->unlockField($ignore);
Expand Down

0 comments on commit c60f3fb

Please sign in to comment.