fix for FormHelper::select() showEmpty

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4067 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2006-12-04 18:00:36 +00:00
parent ecb2b8c786
commit b72ab690d4

View file

@ -471,11 +471,9 @@ class FormHelper extends AppHelper {
if($showEmpty === true) { if($showEmpty === true) {
$showEmpty = ''; $showEmpty = '';
} }
if (isset($options['']) && is_array($options[''])) { $options = array_reverse($options, true);
$options = am($options, $options['']); $options[''] = $showEmpty;
unset($options['']); $options = array_reverse($options, true);
}
$options = am(array('' => $showEmpty), $options);
} }
$select = am($select, $this->__selectOptions(array_reverse($options, true), $selected, array(), $showParents)); $select = am($select, $this->__selectOptions(array_reverse($options, true), $selected, array(), $showParents));
$select[] = sprintf($this->Html->tags['selectend']); $select[] = sprintf($this->Html->tags['selectend']);