[ 'class' => \yii\filters\AccessControl::className(), 'only' => ['towel'], 'rules' => [ // allow authenticated users [ 'allow' => true, 'roles' => ['@'], ], // everything else is denied ], ], ]; } /** * Lists all Log models. * @param $id_card * @return mixed * @throws \Yii\web\NotFoundHttpException */ public function actionTowel($id_card) { $card = Card::findOne ( $id_card ); if (! isset ( $card )) throw new NotFoundHttpException ( 'A bérlet nem található' ); $searchModel = new LogSearch (); $searchModel->card = $card; $searchModel->customer = $card->customer; $dataProvider = $searchModel->search ( Yii::$app->request->queryParams ); return $this->render ( 'index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider ] ); } /** * Finds the Log model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * * @param integer $id * @return Log the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Log::findOne ( $id )) !== null) { return $model; } else { throw new NotFoundHttpException ( 'The requested page does not exist.' ); } } }