Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #664 from tigrang/inputDefaults-setter

Making FormHelper::inputDefaults() code more readable
  • Loading branch information...
commit b0049921a45e1096a329f87fefd08e14eaf0ba69 2 parents e58e3c5 + 671c312
@markstory markstory authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/Cake/View/Helper/FormHelper.php
View
6 lib/Cake/View/Helper/FormHelper.php
@@ -2592,7 +2592,11 @@ protected function _initInputField($field, $options = array()) {
*/
public function inputDefaults($defaults = null, $merge = false) {
if (!is_null($defaults)) {
- $this->_inputDefaults = array_merge($merge ? $this->_inputDefaults : array(), (array)$defaults);
+ if ($merge) {
+ $this->_inputDefaults = array_merge($this->_inputDefaults, (array)$defaults);
+ } else {
+ $this->_inputDefaults = (array)$defaults;
+ }
}
return $this->_inputDefaults;
}
Please sign in to comment.
Something went wrong with that request. Please try again.