<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, 'snmp_template_id'); ?> <?php //echo $form->textField($model,'snmp_template_id'); ?> <?php echo $form->dropDownList($model, 'snmp_template_id', CHtml::listData(SnmpTemplate::model()->findAll(), 'id', 'name'), array('empty' => '')); ?> <?php echo $form->error($model, 'snmp_template_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'snmp_field_id'); ?> <?php //echo $form->textField($model,'snmp_field_id'); ?> <?php echo $form->dropDownList($model, 'snmp_field_id', CHtml::listData(SnmpField::model()->findAll(), 'id', 'label'), array('empty' => ''));
echo $form->labelEx($model, 'label'); ?> <?php echo $form->textField($model, 'label', array('size' => 60, 'maxlength' => 100)); ?> <?php echo $form->error($model, 'label'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'templates'); ?> <?php echo $form->dropDownList($model, 'templates', CHtml::listData(SnmpTemplate::model()->findAll(), 'id', 'name'), array('multiple' => 'multiple', 'size' => 15)); ?> <?php echo $form->error($model, 'templates'); ?> <?php echo CHtml::link('Create template', array('/snmpTemplate/create')); ?> </div> <div class="row buttons"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?> </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 SnmpTemplate the loaded model * @throws CHttpException */ public function loadModel($id) { $model = SnmpTemplate::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }