PHP Class yii2tech\admin\behaviors\action\RoleBehavior

This behavior should be attached to Action instance. This behavior relies on events triggered by ModelFormTrait.
See also: https://github.com/yii2tech/ar-role
See also: yii2tech\admin\actions\ModelFormTrait
Since: 1.0
Author: Paul Klimov ([email protected])
Inheritance: extends yii\base\Behavior
ファイルを表示 Open project: yii2tech/admin Class Usage Examples

Public Properties

Property Type Description
$roleNames list of model role behavior names, which should be affected by the action. If empty - all instances of RoleBehavior will be picked up.

Public Methods

Method Description
afterAjaxValidate ( ActionEvent $event ) Performs AJAX validation of the role models via [[ActiveForm::validate()]].
afterDataLoad ( ActionEvent $event ) Handles afterDataLoad event.
events ( )
getRoleModels ( Model | yii\db\ActiveRecordInterface $model ) : Model[] Get role models for the main one.

Private Methods

Method Description
findRoleModels ( Model | yii\db\ActiveRecordInterface $model ) : array

Method Details

afterAjaxValidate() public method

Performs AJAX validation of the role models via [[ActiveForm::validate()]].
public afterAjaxValidate ( ActionEvent $event )
$event yii2tech\admin\ActionEvent event instance.

afterDataLoad() public method

Populates the role models with input data.
public afterDataLoad ( ActionEvent $event )
$event yii2tech\admin\ActionEvent event instance.

events() public method

public events ( )

getRoleModels() public method

Get role models for the main one.
public getRoleModels ( Model | yii\db\ActiveRecordInterface $model ) : Model[]
$model yii\base\Model | yii\db\ActiveRecordInterface main model instance.
return yii\base\Model[] list of role models

Property Details

$roleNames public_oe property

list of model role behavior names, which should be affected by the action. If empty - all instances of RoleBehavior will be picked up.
public $roleNames