コード例 #1
0
ファイル: GeoController.php プロジェクト: postfx/fermion
 public function actionRegions()
 {
     $country_id = Yii::app()->request->getQuery('country_id', 0);
     $regions = BglGeoRegion::model()->findAllByAttributes(array('countryid' => $country_id));
     print json_encode(CHtml::listData($regions, 'id', 'name'));
     Yii::app()->end();
 }
コード例 #2
0
ファイル: register.php プロジェクト: postfx/fermion
                                     <div class="reg-field data-header">
                                         <label>Страна <span>*</span></label>
                                         <div class="select-wrap">
                                         	<?php 
 echo $form->dropDownList($model, "country_id", CHtml::listData(BglGeoCountry::model()->findAll('id=3159'), 'id', 'name'));
 ?>
                                         	<?php 
 echo $form->error($model, "country_id");
 ?>
                                         </div>
                                     </div>
                                     <div class="reg-field data-header">
                                         <label>Область</label>
                                         <div class="select-wrap">
                                         	<?php 
 echo $form->dropDownList($model, "region_id", array('' => '') + CHtml::listData(BglGeoRegion::model()->findAll('countryid=3159'), 'id', 'name'));
 ?>
                                         	<?php 
 echo $form->error($model, "region_id");
 ?>
                                         </div>
                                     </div>
                                     <div class="reg-field data-header">
                                         <label>Город</label>
                                         <div class="select-wrap">
                                         	<?php 
 echo $form->dropDownList($model, "city_id", array());
 ?>
                                         	<?php 
 echo $form->error($model, "city_id");
 ?>