示例#1
0
																updateDropdown(this, $("#' . $form_name . '_birthplace_state_id"), data);
															}')));
?>
						<?php 
echo CHtml::error($model, 'birthplace_country_id');
?>
					</div>
				</div>

				<div class="form-group">
					<?php 
echo CHtml::activeLabelEx($model, 'birthplace_state_id', array('class' => $label_class));
?>
					<div class="col-md-6 col-xs-12">
						<?php 
echo CHtml::activeDropDownList($model, 'birthplace_state_id', CHtml::listData(ReferenceGeoStates::model()->byOrder()->findAll(), 'id', 'name'), array('data-placeholder' => at('Please select one...'), 'prompt' => '', 'data-live-search' => 'true', 'class' => 'validate[required] form-control select', 'ajax' => array('type' => 'GET', 'url' => array('geography/states/dynamicCities'), 'data' => array('id' => 'js:this.value'), 'success' => 'function(data){
																updateDropdown(this, $("#' . $form_name . '_birthplace_city_id"), data);
															}')));
?>
						<?php 
echo CHtml::error($model, 'birthplace_state_id');
?>
					</div>
				</div>

				<div class="form-group">
					<?php 
echo CHtml::activeLabelEx($model, 'birthplace_city_id', array('class' => $label_class));
?>
					<div class="col-md-6 col-xs-12">
						<?php 
示例#2
0
					<div class="col-md-6 col-xs-12">
						<?php 
$datas = CHtml::listData(ReferenceGeoCountries::model()->byOrder()->findAll(), 'id', 'name');
echo CHtml::activeDropDownList($address, 'country_id', $datas, array('data-placeholder' => at('Please select one...'), 'prompt' => '', 'data-live-search' => 'true', 'class' => 'validate[required] form-control select'));
?>
						<div id="errorCountry_id" class="errorMessage"></div>
					</div>
				</div>

				<div class="form-group">
					<?php 
echo CHtml::activeLabelEx($address, 'state_id', array('class' => $label_class));
?>
					<div class="col-md-6 col-xs-12">
						<?php 
echo CHtml::activeDropDownList($address, 'state_id', CHtml::listData(ReferenceGeoStates::model()->byCountry($address->country_id)->byOrder()->findAll(), 'id', 'name'), array('data-placeholder' => at('Please select one...'), 'prompt' => '', 'data-live-search' => 'true', 'class' => 'validate[required] form-control select'));
?>
						<div id="errorState_id" class="errorMessage"></div>
					</div>
				</div>

				<div class="form-group">
					<?php 
echo CHtml::activeLabelEx($address, 'city_id', array('class' => $label_class));
?>
					<div class="col-md-6 col-xs-12">
						<?php 
echo CHtml::activeDropDownList($address, 'city_id', CHtml::listData(ReferenceGeoCities::model()->byState($address->state_id)->byOrder()->findAll(), 'id', 'name'), array('data-placeholder' => at('Please select one...'), 'prompt' => '', 'data-live-search' => 'true', 'class' => 'validate[required] form-control select'));
?>
						<div id="errorCity_id" class="errorMessage"></div>
					</div>
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return ReferenceGeoStates the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = ReferenceGeoStates::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }