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

attachBehaviors() public méthode

Each behavior is indexed by its name and should be a Behavior object, a string specifying the behavior class, or an configuration array for creating the behavior.
See also: attachBehavior()
public attachBehaviors ( array $behaviors )
$behaviors array list of behaviors to be attached to the component
    public function attachBehaviors($behaviors)
    {
        $this->ensureBehaviors();
        foreach ($behaviors as $name => $behavior) {
            $this->attachBehaviorInternal($name, $behavior);
        }
    }