/** * 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 Accesory the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Accesory::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
?> <?php echo $form->dropDownList($model, 'accesory_id', Chtml::listData(Accesory::model()->findAll(array('condition' => 'active=1', 'order' => 'name')), 'id', 'name'), array('prompt' => 'Seleccionar')); ?> <?php echo CHtml::button('+', array('id' => 'addAccesory')); ?> <?php echo CHtml::button('-', array('id' => 'removeAccesory')); ?> <div> <?php echo $form->dropDownList($model, 'accesory', CHtml::listData(Accesory::model()->findAllByPk($model->accesory), 'id', 'name'), array('multiple' => 'multiple', 'size' => '5', 'style' => 'min-width:200px;')); ?> </div> <?php echo $form->error($model, 'accesory'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, '_failureDescription'); ?> <?php //echo $form->dropDownList($model,'dependences', CHtml::listData($model->getDependencias(), 'id','name')); ?>
/** * Datos para llenar las tablas de productos */ public function getServicios() { return $ModelDependencias = Accesory::model()->findAll('active = 1'); }