Example #1
0
                <?php 
echo $form->labelEx($model, 'vehicle_reg_no');
?>
                <?php 
echo $form->textField($model, 'vehicle_reg_no', array('span' => 5, 'maxlength' => 245));
?>
            </div>

        </div>
        <div class="row">
            <div style="float:left;width:200px;" >
                <?php 
echo $form->labelEx($model, 'vehicle_category');
?>
                <?php 
echo $form->dropDownList($model, 'vehicle_category', CHtml::listData(VehicleCatagory::model()->findAll(array('order' => 'id ASC')), 'id', 'name'), array('span' => 5, 'maxlength' => 45));
?>
            </div>
            <div style="float:left;width:200px;" >
                <?php 
echo $form->labelEx($model, 'vehicle_type');
?>
                <?php 
echo $form->dropDownList($model, 'vehicle_type', CHtml::listData(VehicleType::model()->findAll(array('order' => 'type ASC')), 'id', 'type'), array('span' => 5, 'maxlength' => 45));
?>
            </div>
            <div style="float:left;width:200px;" >
                <?php 
echo $form->labelEx($model, 'vehicle_make_id');
?>
                <?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 VehicleCatagory the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = VehicleCatagory::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }