This behavior should be attached to Controller instance.
Since: 1.0
Author: Paul Klimov (klimov.paul@gmail.com)
Inheritance: extends yii\base\Behavior
Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function newSearchModel()
 {
     $model = parent::newSearchModel();
     foreach ($this->getContextModels() as $name => $contextModel) {
         $attribute = $this->contexts[$name]['attribute'];
         $model->{$attribute} = $contextModel->getPrimaryKey();
     }
     return $model;
 }
Exemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return ['model' => ['class' => ModelControlBehavior::className(), 'modelClass' => $this->modelClass, 'searchModelClass' => $this->searchModelClass], 'access' => ['class' => AccessControl::className(), 'rules' => $this->accessRules()], 'verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['post']]]];
 }