Exemplo n.º 1
0
 public function actionBrowse()
 {
     $this->layout = 'admin';
     $searchModel = new ArticleSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->sort = ['defaultOrder' => ['published_at' => SORT_DESC]];
     return $this->render('browse', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Exemplo n.º 2
0
 /**
  * Lists all Article models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new ArticleSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());
     return $this->render('index', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel]);
 }