Пример #1
0
 /**
  * @inheritdoc
  * @param \yii\base\Action $action
  * @return bool
  * @throws NotFoundHttpException
  */
 public function beforeAction($action)
 {
     if (!Yii::$app->params['enableBlog']) {
         throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));
     }
     return parent::beforeAction($action);
     // TODO: Change the autogenerated stub
 }
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     $parent = parent::behaviors();
     return array_merge($parent, ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['POST']]]]);
 }
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     $adminRules = parent::behaviors()['access']['rules'];
     $rules = array_merge([['actions' => ['login', 'auth'], 'allow' => true, 'roles' => ['?']]], $adminRules);
     return ['access' => ['class' => AccessControl::className(), 'rules' => $rules]];
 }