mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
"A little more refactoring on HtmlHelper::checkbox()"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4226 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
90f6c38614
commit
9f48b1d28c
1 changed files with 2 additions and 2 deletions
|
@ -366,14 +366,14 @@ class HtmlHelper extends AppHelper {
|
|||
$notCheckedValue = -1;
|
||||
}
|
||||
} else {
|
||||
if (isset($htmlAttributes['value']) || (!class_exists($this->model()) && !loadModel($this->model()))) {
|
||||
$model = $this->model();
|
||||
if (isset($htmlAttributes['value']) || (!class_exists($model) && !loadModel($model))) {
|
||||
$htmlAttributes['checked'] = ($htmlAttributes['value'] == $value) ? 'checked' : null;
|
||||
|
||||
if ($htmlAttributes['value'] == '0') {
|
||||
$notCheckedValue = -1;
|
||||
}
|
||||
} else {
|
||||
$model = $this->model();
|
||||
$model = new $model;
|
||||
$db =& ConnectionManager::getDataSource($model->useDbConfig);
|
||||
$value = $db->boolean($value);
|
||||
|
|
Loading…
Reference in a new issue