Skip to content
Permalink
Browse files

Reformat and use short array syntax.

  • Loading branch information...
markstory committed Mar 4, 2014
1 parent 8543478 commit c60f3fbf836c8f8ac36f4d6fbc276224c59eed13
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/View/Helper/FormHelper.php
@@ -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.
*
@@ -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));
@@ -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);

0 comments on commit c60f3fb

Please sign in to comment.
You can’t perform that action at this time.