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