/**
  * 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.
  */
 public function loadModel()
 {
     if ($this->_model === null) {
         if (isset($_GET['id'])) {
             $this->_model = InstructorType::model()->findbyPk($_GET['id']);
         }
         if ($this->_model === null) {
             throw new CHttpException(404, 'The requested page does not exist.');
         }
     }
     return $this->_model;
 }
Exemple #2
0
?>
		<?php 
echo $form->textField($model, 'note', array('size' => 60, 'maxlength' => 256));
?>
		<?php 
echo $form->error($model, 'note');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'instructor_type_id');
?>

<?php 
echo $form->dropDownList($model, 'instructor_type_id', CHtml::listData(InstructorType::model()->findAll(), 'id', 'description'));
?>

		<?php 
echo $form->error($model, 'instructor_type_id');
?>
	</div>


	<div class="row">
		<?php 
echo $form->labelEx($model, 'company_id');
?>

<?php 
echo $form->dropDownList($model, 'company_id', CHtml::listData(Company::model()->findAll(), 'id', 'name'));