Skip to content
Permalink
Browse files

Made FormHelper::inputDefaults() alawys return inputDefaults array

  • Loading branch information...
tigrang committed May 20, 2012
1 parent fd0dd7e commit 57ad5e2573198781deb1586242f62a5b62fe26f9
Showing with 4 additions and 8 deletions.
  1. +4 −8 lib/Cake/View/Helper/FormHelper.php
@@ -2588,17 +2588,13 @@ protected function _initInputField($field, $options = array()) {
*
* @param array $defaults New default values
* @param boolean Merge with current defaults
* @return mixed array|void Current inputDefaults
* @return array inputDefaults
*/
public function inputDefaults($defaults = null, $merge = false) {
if (is_null($defaults)) {
return $this->_inputDefaults;
}
if ($merge) {
$this->_inputDefaults = array_merge($this->_inputDefaults, (array)$defaults);
} else {
$this->_inputDefaults = (array)$defaults;
if (!is_null($defaults)) {
$this->_inputDefaults = array_merge($merge ? $this->_inputDefaults : array(), (array)$defaults);
}
return $this->_inputDefaults;
}
}

0 comments on commit 57ad5e2

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