echo CHtml::activeDropDownList($model, 'memberID', Chtml::listData(Members::model()->findAll(), 'memberID', 'memberName'), array('empty' => 'Select a Member')); ?> <?php echo $form->error($model, 'memberID'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'govermentTypeID'); ?> <?php //echo $form->textField($model,'govermentTypeID',array('size'=>11,'maxlength'=>11)); ?> <?php echo CHtml::activeDropDownList($model, 'govermentTypeID', Chtml::listData(GovermentTypes::model()->findAll(), 'govermentTypeID', 'govermentTypeName'), array('empty' => 'Select a Goverment Type')); ?> <?php echo $form->error($model, 'govermentTypeID'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'capital'); ?> <?php echo $form->textField($model, 'capital', array('size' => 60, 'maxlength' => 120)); ?> <?php echo $form->error($model, 'capital');
/** * 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 GovermentTypes the loaded model * @throws CHttpException */ public function loadModel($id) { $model = GovermentTypes::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }