mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Making FormHelper::inputDefaults() code more readable
This commit is contained in:
parent
e58e3c5314
commit
671c31218f
1 changed files with 5 additions and 1 deletions
|
@ -2592,7 +2592,11 @@ class FormHelper extends AppHelper {
|
|||
*/
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue