Inheritance: extends yii\web\Controller
Exemplo n.º 1
0
 /**
  * @param \yii\base\Action $action
  * @return bool
  * @throws \yii\web\BadRequestHttpException
  */
 public function beforeAction($action)
 {
     if (parent::beforeAction($action)) {
         if ($action->id == 'error' && Yii::$app->user->isGuest) {
             $this->layout = 'main-login';
         }
         return true;
     } else {
         return false;
     }
 }
 public function behaviors()
 {
     return ArrayHelper::merge(parent::behaviors(), ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['post']]]]);
 }
Exemplo n.º 3
0
 public function behaviors()
 {
     $behavior = parent::behaviors();
     $access = $behavior['access'];
     return ['access' => $access, 'verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['post']]]];
 }
Exemplo n.º 4
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return ArrayHelper::merge(parent::behaviors(), ['access' => ['class' => AccessControl::className(), 'rules' => [['actions' => ['error'], 'allow' => true], ['actions' => ['index'], 'allow' => true, 'roles' => ['@']]]]]);
 }