This method will create the behavior object based on the given
configuration. After that, the behavior object will be attached to
this component by calling the [[Behavior::attach()]] method.
public attachBehavior ( string $name, string | array | |
||
$name | string | the name of the behavior. |
$behavior | string | array | |
the behavior configuration. This can be one of the following: - a [[Behavior]] object - a string specifying the behavior class - an object configuration array that will be passed to [[Yii::createObject()]] to create the behavior object. |
Результат | the behavior object |