Browse Source

Merge pull request #1703 from crtlib/patch-2

Removed redundant code in detachBehaviors()
tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
bf73fe80d4
  1. 7
      framework/yii/base/Component.php

7
framework/yii/base/Component.php

@ -543,12 +543,9 @@ class Component extends Object
public function detachBehaviors()
{
$this->ensureBehaviors();
if ($this->_behaviors !== null) {
foreach ($this->_behaviors as $name => $behavior) {
$this->detachBehavior($name);
}
foreach ($this->_behaviors as $name => $behavior) {
$this->detachBehavior($name);
}
$this->_behaviors = [];
}
/**

Loading…
Cancel
Save