/**
  * 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 HostFace the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = HostFace::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
示例#2
0
echo $form->labelEx($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, 'host_face_id');
?>
        <?php 
echo $form->dropDownList($model, 'host_face_id', CHtml::listData(HostFace::model()->findAll(), 'id', 'name'), array('empty' => ''));
?>
            <?php 
echo CHtml::link('Create host face', array('hostFace/create'));
?>
        <?php 
echo $form->error($model, 'host_face_id');
?>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
	</div>