yii\base\Component::detachBehavior PHP Méthode

detachBehavior() public méthode

The behavior's [[Behavior::detach()]] method will be invoked.
public detachBehavior ( string $name ) : null | Behavior
$name string the behavior's name.
Résultat null | Behavior the detached behavior. Null if the behavior does not exist.
    public function detachBehavior($name)
    {
        $this->ensureBehaviors();
        if (isset($this->_behaviors[$name])) {
            $behavior = $this->_behaviors[$name];
            unset($this->_behaviors[$name]);
            $behavior->detach();
            return $behavior;
        } else {
            return null;
        }
    }