?> <?php echo $form->dropDownList($model, 'tipo_inventario', array('Productos' => 'Productos', 'Insumos' => 'Insumos', 'Consumibles' => 'Consumibles')); ?> <?php echo $form->error($model, 'tipo_inventario'); ?> </div> <div class="span4"> <?php echo $form->labelEx($model, 'producto_categoria_id'); ?> <?php echo $form->dropDownList($model, 'producto_categoria_id', CHtml::listData(ProductoCategoria::model()->findAll("id > 0 order by 'categoria'"), 'id', 'categoria'), array('class' => 'input-xlarge')); ?> <?php echo $form->error($model, 'producto_categoria_id'); ?> </div> </div> <?php //Mostrar solo si es Modificación ?> <?php if (!$model->isNewRecord) { ?> <div class="row">
/** * 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 ProductoCategoria the loaded model * @throws CHttpException */ public function loadModel($id) { $model = ProductoCategoria::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }