fixing wrong file name for missing component in 1.2, and fixing some bad code I introduced into the form helper

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3579 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2006-09-28 02:38:58 +00:00
parent 67aba9ea45
commit 89b34f30ca
2 changed files with 2 additions and 7 deletions

View file

@ -102,7 +102,7 @@ class Component extends Object {
return $this->cakeError('missingComponentFile', array(array(
'className' => $this->controller->name,
'component' => $component,
'file' => Inflector::underscore($componentCn) . '.php',
'file' => Inflector::underscore($component) . '.php',
'base' => $this->controller->base
)));
}

View file

@ -318,17 +318,12 @@ class FormHelper extends Helper {
if($showEmpty === true) {
$showEmpty = '';
}
$options = array_reverse($options);
$options[] = $showEmpty;
$options = array_reverse($options);
/*nate's old code
$keys = array_keys($options);
$vals = array_values($options);
array_unshift($keys, '');
array_unshift($vals, $showEmpty);
$options = array_combine($keys, $vals);*/
$options = array_combine($keys, $vals);
}
$select = am($select, $this->__selectOptions(array_reverse($options), $selected, array(), $showParents));
$select[] = sprintf($this->tags['selectend']);
return $this->output(implode("\n", $select));