Browse Source

Revert "Better handling of trying to configure already instantiated component"

This reverts commit 6b15768a3f.
tags/2.0.0-beta
Alexander Makarov 11 years ago
parent
commit
6bcacec946
  1. 5
      framework/yii/base/Module.php

5
framework/yii/base/Module.php

@ -546,16 +546,11 @@ abstract class Module extends Component
public function setComponents($components) public function setComponents($components)
{ {
foreach ($components as $id => $component) { foreach ($components as $id => $component) {
if (isset($this->_components[$id]) && !($this->_components[$id] instanceof Object)) {
if (isset($this->_components[$id]['class']) && !isset($component['class'])) { if (isset($this->_components[$id]['class']) && !isset($component['class'])) {
$component['class'] = $this->_components[$id]['class']; $component['class'] = $this->_components[$id]['class'];
} }
$this->_components[$id] = $component; $this->_components[$id] = $component;
} }
else {
throw new Exception('Cannot set component "'.$id.'" that is already instantiated.');
}
}
} }
/** /**

Loading…
Cancel
Save