示例#1
0
 /**
  * Lists all Car4 models.
  * @return mixed
  */
 public function actionIndex()
 {
     $session = new Session();
     $session->open();
     $page = 30;
     if (isset($session["perpage"])) {
         $page = $session["perpage"];
     }
     //        if(\Yii::$app->request->isAjax){
     //            $page =(integer) \Yii::$app->request->post('page');
     //
     //            return;
     //        }
     //
     $searchModel = new Car4Search();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->pagination->pageSize = $page;
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'perpagex' => $page]);
 }
示例#2
0
 /**
  * Lists all Car4 models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new Car4Search();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }