$datos = CHtml::listData(Plantas::model()->findAll(), 'codplanta', 'desplanta'); echo $form->DropDownList($model, 'puerto', $datos, array('empty' => '--Seleccione una Planta--')); ?> <?php echo $form->error($model, 'puerto'); ?> </div> <div style="float: left; clear:right; width:350px;"> <?php echo $form->labelEx($model, 'puertodes'); ?> <?php $datos = CHtml::listData(Plantas::model()->findAll(), 'codplanta', 'desplanta'); echo $form->DropDownList($model, 'puertodes', $datos, array('empty' => '--Seleccione una Planta--')); ?> <?php echo $form->error($model, 'puertodes'); ?> </div> </div> <div style="float: left; width:700px; border :1px;"> <div style="float: left; width:350px;"> <?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 the ID of the model to be loaded */ public function loadModel($id) { $model = Plantas::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'El enlace o direccion solicitado no existe'); } return $model; }