Exemplo n.º 1
0
 /**
  * Lists all Country models.
  * @return mixed
  */
 public function actionIndex()
 {
     $model = new Country();
     if ($model->load(\Yii::$app->request->post()) && $model->save()) {
         $model = new Country();
         //reset model
     }
     $searchModel = new CountrySearch();
     $dataProvider = $searchModel->search(\Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'model' => $model]);
 }
Exemplo n.º 2
0
 public function prepareDataProvider()
 {
     $model = new CountrySearch();
     return $model->search(Yii::$app->request->queryParams);
 }