示例#1
0
 public function actionGetCityList($state = '', $model = '', $display = 'table', $class = null)
 {
     if (!$model) {
         $model = new GeoCity();
     }
     if (!$class) {
         $class = 'select_box';
     }
     $stateId = '';
     if (isset($_POST['GeoState']['state'])) {
         $stateId = $_POST['GeoState']['state'];
     } elseif ($state) {
         $state = GeoStateApi::getState($state);
         if ($state) {
             $stateId = $state->id;
         }
     }
     if ($stateId) {
         $list = GeoCityApi::getList($stateId);
     } else {
         $list = GeoCityApi::getCityList($stateId);
     }
     //	$list = null;
     $this->renderPartial('getCityList', array('list' => $list, 'model' => $model, 'display' => $display, 'class' => $class));
 }