?> <?php echo $form->error($model, 'username'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'type'); ?> <?php /*echo $form->dropDownList($model,'type', CHtml::listData(Usertype::model()->findall(),'id','role')); */ ?> <?php echo CHtml::activeDropDownList($model, 'type', CHtml::listData(Usertype::model()->findall(), 'role', 'role')); ?> <?php echo $form->error($model, 'type'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'email'); ?> <?php echo $form->textField($model, 'email', array('size' => 60, 'maxlength' => 255)); ?> <?php
/** * 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 Usertype the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Usertype::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }