Exemplo n.º 1
0
 /**
  * @return string
  */
 public function actionIndex()
 {
     if ($tmp = Yii::$app->request->get('NewsSearch')) {
         $click = isset($tmp['category_id']) ? $tmp['category_id'] : null;
     }
     $view = Yii::$app->view;
     $view->params['click'] = empty($click) ? null : $click;
     $searchModel = new NewsSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Exemplo n.º 2
0
 /**
  * Lists all News models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new NewsSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }