Ejemplo n.º 1
0
 /**
  * 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]);
 }
Ejemplo n.º 2
0
 /**
  * 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]);
 }
Ejemplo n.º 3
0
 /**
  * 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]);
 }