Метод | Описание | |
---|---|---|
__call ( string $name, array $params ) : mixed | Calls the named method which is not a class method. | |
__clone ( ) | This method is called after the object is created by cloning an existing one. | |
__get ( string $name ) : mixed | Returns the value of a component property. | |
__isset ( string $name ) : boolean | Checks if a property is set, i.e. defined and not null. | |
__set ( string $name, mixed $value ) | Sets the value of a component property. | |
__unset ( string $name ) | Sets a component property to be null. | |
attachBehavior ( string $name, string | array | |
Attaches a behavior to this component. | |
attachBehaviors ( array $behaviors ) | Attaches a list of behaviors to the component. | |
behaviors ( ) : array | Returns a list of behaviors that this component should behave as. | |
canGetProperty ( string $name, boolean $checkVars = true, boolean $checkBehaviors = true ) : boolean | Returns a value indicating whether a property can be read. | |
canSetProperty ( string $name, boolean $checkVars = true, boolean $checkBehaviors = true ) : boolean | Returns a value indicating whether a property can be set. | |
detachBehavior ( string $name ) : null | |
Detaches a behavior from the component. | |
detachBehaviors ( ) | Detaches all behaviors from the component. | |
ensureBehaviors ( ) | Makes sure that the behaviors declared in Component::behaviors are attached to this component. | |
getBehavior ( string $name ) : null | |
Returns the named behavior object. | |
getBehaviors ( ) : |
Returns all behaviors attached to this component. | |
hasEventHandlers ( string $name ) : boolean | Returns a value indicating whether there is any handler attached to the named event. | |
hasMethod ( string $name, boolean $checkBehaviors = true ) : boolean | Returns a value indicating whether a method is defined. | |
hasProperty ( string $name, boolean $checkVars = true, boolean $checkBehaviors = true ) : boolean | Returns a value indicating whether a property is defined for this component. | |
off ( string $name, callable $handler = null ) : boolean | Detaches an existing event handler from this component. | |
on ( string $name, callable $handler, mixed $data = null, boolean $append = true ) | Attaches an event handler to an event. | |
trigger ( string $name, |
Triggers an event. |
Метод | Описание | |
---|---|---|
attachBehaviorInternal ( string | integer $name, string | array | |
Attaches a behavior to this component. |
public __clone ( ) |
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 |
public attachBehaviors ( array $behaviors ) | ||
$behaviors | array | list of behaviors to be attached to the component |
public canGetProperty ( string $name, boolean $checkVars = true, boolean $checkBehaviors = true ) : boolean | ||
$name | string | the property name |
$checkVars | boolean | whether to treat member variables as properties |
$checkBehaviors | boolean | whether to treat behaviors' properties as properties of this component |
Результат | boolean | whether the property can be read |
public canSetProperty ( string $name, boolean $checkVars = true, boolean $checkBehaviors = true ) : boolean | ||
$name | string | the property name |
$checkVars | boolean | whether to treat member variables as properties |
$checkBehaviors | boolean | whether to treat behaviors' properties as properties of this component |
Результат | boolean | whether the property can be written |
public detachBehavior ( string $name ) : null | |
||
$name | string | the behavior's name. |
Результат | null | |
the detached behavior. Null if the behavior does not exist. |
public detachBehaviors ( ) |
public ensureBehaviors ( ) |
public getBehavior ( string $name ) : null | |
||
$name | string | the behavior name |
Результат | null | |
the behavior object, or null if the behavior does not exist |
public getBehaviors ( ) : |
||
Результат | list of behaviors attached to this component |
public hasEventHandlers ( string $name ) : boolean | ||
$name | string | the event name |
Результат | boolean | whether there is any handler attached to the event. |
public hasProperty ( string $name, boolean $checkVars = true, boolean $checkBehaviors = true ) : boolean | ||
$name | string | the property name |
$checkVars | boolean | whether to treat member variables as properties |
$checkBehaviors | boolean | whether to treat behaviors' properties as properties of this component |
Результат | boolean | whether the property is defined |
public on ( string $name, callable $handler, mixed $data = null, boolean $append = true ) | ||
$name | string | the event name |
$handler | callable | the event handler |
$data | mixed | the data to be passed to the event handler when the event is triggered. When the event handler is invoked, this data can be accessed via [[Event::data]]. |
$append | boolean | whether to append new event handler to the end of the existing handler list. If false, the new handler will be inserted at the beginning of the existing handler list. |