/** * Lists all Comment models. * @return mixed */ public function actionIndex() { //if(!Yii::$app->user->can('viewYourAuth')) throw new ForbiddenHttpException(Yii::t('app', 'No Auth')); $searchModel = new CommentSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }
/** * List all User models * * @param int $id * @return mixed * @throws NotFoundHttpException */ public function actionComments($id) { $user = $this->findModel($id); $searchModel = new CommentSearch(); $queryParams = Yii::$app->request->getQueryParams(); $queryParams['CommentSearch']['user_id'] = $user->id; $dataProvider = $searchModel->search($queryParams); return $this->render('comments', ['user' => $user, 'dataProvider' => $dataProvider, 'searchModel' => $searchModel]); }
/** * Lists all Comment models. * @return mixed */ public function actionIndex() { $searchModel = new CommentSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }