/** * 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 GroupTypes the loaded model * @throws CHttpException */ public function loadModel($id) { $model = GroupTypes::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php $form = $this->beginWidget('CActiveForm', array('id' => 'groups-form', 'enableAjaxValidation' => false)); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <?php echo $form->errorSummary($model); ?> <div class="row"> <?php echo $form->labelEx($model, 'groupTypeID'); ?> <?php echo CHtml::activeDropDownList($model, 'groupTypeID', Chtml::listData(GroupTypes::model()->findAll(), 'groupTypeID', 'groupTypeName'), array('empty' => 'Select a Group Type Name')); ?> <?php echo $form->error($model, 'groupTypeID'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'groupName'); ?> <?php echo $form->textField($model, 'groupName', array('size' => 45, 'maxlength' => 45)); ?> <?php echo $form->error($model, 'groupName');