/** * Lists all Blog models. * @return mixed */ public function actionIndex() { if (Yii::$app->user->can('admin')) { $searchModel = new BlogSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); } else { return parent::actionLogin(); } }
/** * Lists all Blog models. * @return mixed */ public function actionIndex() { $searchModel = new BlogSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }