mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +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 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue