Skip to content
Browse files

Making FormHelper::inputDefaults() code more readable

  • Loading branch information...
1 parent e58e3c5 commit 671c31218f6f4a9f33277e0b3467f50f7b9c098f @tigrang committed May 21, 2012
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;
}

0 comments on commit 671c312

Please sign in to comment.
Something went wrong with that request. Please try again.