Exemple #1
0
 public function actionIndex()
 {
     /*
     $authors = Author::find();
     $dataProvider = new ActiveDataProvider([
         'query' => $authors,
     ]);
     
     return $this->render('index', ['authors' => $dataProvider]);
     */
     $searchModel = new AuthorSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['authors' => $dataProvider, 'searchModel' => $searchModel]);
 }
 /**
  * Lists all Author models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new AuthorSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }