Exemplo n.º 1
0
 /**
  * REQUEST:
  * - term str
  * - country int or empty
  * @return array
  */
 public function actionRegion()
 {
     $term = \Yii::$app->request->get('term');
     $country = \Yii::$app->request->get('country');
     \Yii::$app->response->format = Response::FORMAT_JSON;
     return \cs\models\Place\Region::findAll($term, $country);
 }
Exemplo n.º 2
0
 /**
  * Возращает список городов по запросу get param=term
  *
  * @return string JSON
  */
 public function actionPlace_region($id)
 {
     $term = static::getParam('term');
     return Json::encode(\cs\models\Place\Region::findAll($term, $id));
 }