Пример #1
0
 public function actionGetRegions()
 {
     $regions = Region::find()->all();
     return json_encode(['success' => true, 'data' => ArrayHelper::toArray($regions)]);
 }
Пример #2
0
 /**
  * Lists all Region models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Region::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }