/** * @inheritdoc */ public function beforeAction($action) { if (parent::beforeAction($action)) { if ($this->enableOnlyActions !== [] and in_array($action->id, $this->_implementedActions) and !in_array($action->id, $this->enableOnlyActions)) { throw new NotFoundHttpException('Page not found'); } if (in_array($action->id, $this->disabledActions)) { throw new NotFoundHttpException('Page not found'); } return true; } return false; }
public function behaviors() { return ArrayHelper::merge(parent::behaviors(), ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['logout' => ['post'], 'upload-avatar' => ['post'], 'remove-avatar' => ['post']]]]); }