[ 'class' => VerbFilter::className(), 'actions' => [ 'allow-card' => ['post'], ], ], ]; } public function actionAllowCard($idCard) { $card = Card::findOne($idCard); if (!isset($card)){ throw new BadRequestHttpException("card id not found"); } $doorCardPassManager = new DoorCardPassManager(); $doorCardPassManager->createNewDoorCardPass($idCard); $doorCardPassManager->updateDoorCardPassStateForCard($idCard); $this->redirect(['customer/reception', 'number' => $card->number]); } /** * Displays a single City model. * @param integer $id * @return mixed */ public function actionView($id) { } /** * Finds the City model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return City the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = City::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } } }