mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-01 23:29:45 +00:00
Made FormHelper::inputDefaults() alawys return inputDefaults array
This commit is contained in:
parent
fd0dd7ec04
commit
57ad5e2573
1 changed files with 4 additions and 8 deletions
|
@ -2588,17 +2588,13 @@ class FormHelper extends AppHelper {
|
||||||
*
|
*
|
||||||
* @param array $defaults New default values
|
* @param array $defaults New default values
|
||||||
* @param boolean Merge with current defaults
|
* @param boolean Merge with current defaults
|
||||||
* @return mixed array|void Current inputDefaults
|
* @return array inputDefaults
|
||||||
*/
|
*/
|
||||||
public function inputDefaults($defaults = null, $merge = false) {
|
public function inputDefaults($defaults = null, $merge = false) {
|
||||||
if (is_null($defaults)) {
|
if (!is_null($defaults)) {
|
||||||
return $this->_inputDefaults;
|
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue