user->isGuest) return $this->redirect(['/site/login']); } /** * {@inheritdoc} */ public function behaviors() { return [ 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ 'delete' => ['POST'], ], ], ]; } public function actionIndex() { $this->view->title = 'Sự kiện hôm nay'; $searchModel = new LogsSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); } protected function findModel($id) { if (($model = Logs::findOne($id)) !== null) { return $model; } throw new NotFoundHttpException('The requested page does not exist.'); } }