mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-18 23:43:19 +08:00
Merge branch 'master'
This commit is contained in:
@@ -539,15 +539,10 @@ 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;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw new Exception('Cannot set component "'.$id.'" that is already instantiated.');
|
|
||||||
}
|
}
|
||||||
|
$this->_components[$id] = $component;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user