public function actionGetList() { $modelProperty = new Property(); $list = null; if (isset($_POST['Project']['city_id'])) { $modelProperty = new Project(); $city_id = $_POST['Project']['city_id']; } elseif (isset($_POST['Property']['city_id'])) { $modelProperty = new Property(); $city_id = $_POST['Property']['city_id']; } else { $modelProperty = new Property(); $city_id = $_POST['GeoCity']['city']; } if ($city_id != "") { $list = GeoLocalityApi::getList($city_id); } $this->renderPartial('getList', array('list' => $list, 'modelProperty' => $modelProperty, 'class' => $class)); }
public function actionRender($name, $request, $modelname) { if (isset($_POST["{$request}"]['city_id'])) { $model = new $modelname(); $city_id = $_POST["{$request}"]['city_id']; $city = GeoCity::model()->findByPk($_POST["{$request}"]['city_id']); if ($city) { $cityName = $city->city; $stateName = $city->state->state; $countryName = $city->state->country->country; $data['city'] = $cityName; $data['state'] = $stateName; $data['country'] = $countryName; } else { return; } } else { return; } $list = GeoLocalityApi::getList($city_id); $this->renderPartial('render', array('data' => $data, 'name' => $name, 'model' => $model, 'list' => $list)); }