Removing duplicated code.

This commit is contained in:
mark_story 2010-09-14 23:15:10 -04:00
parent c255539980
commit 1707c92aa1

View file

@ -497,10 +497,7 @@ class Controller extends Object {
$this->loadModel($this->modelClass, $id);
} elseif ($this->uses) {
$uses = is_array($this->uses) ? $this->uses : array($this->uses);
$modelClassName = $uses[0];
if (strpos($uses[0], '.') !== false) {
list($plugin, $modelClassName) = explode('.', $uses[0]);
}
list($plugin, $modelClassName) = pluginSplit($uses[0]);
$this->modelClass = $modelClassName;
foreach ($uses as $modelClass) {
$this->loadModel($modelClass);