?> <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> </div> <div class="form-group"> <?php echo CHtml::activeLabelEx($address, 'district_id', array('class' => $label_class)); ?> <div class="col-md-6 col-xs-12"> <?php echo CHtml::activeDropDownList($address, 'district_id', CHtml::listData(ReferenceGeoDistricts::model()->byCity($address->city_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="errorDistrict_id" class="errorMessage"></div> </div> </div> <div class="form-group"> <?php echo CHtml::activeLabelEx($address, 'poscode', array('class' => $label_class)); ?> <div class="col-md-6 col-xs-12"> <?php echo CHtml::activeTextField($address, 'poscode', array('size' => 5, 'maxlength' => 5, 'class' => 'form-control')); ?> <div id="errorPoscode" 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 ReferenceGeoDistricts the loaded model * @throws CHttpException */ public function loadModel($id) { $model = ReferenceGeoDistricts::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }