/** * 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 CarreraDepartamento the loaded model * @throws CHttpException */ public function loadModel($id) { $model = CarreraDepartamento::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php echo CHtml::encode($data->clave); ?> <br /> <b><?php echo CHtml::encode($data->getAttributeLabel('rfid')); ?>:</b> <?php echo CHtml::encode($data->rfid); ?> <br /> */ ?> <b><?php echo CHtml::encode($data->getAttributeLabel('tipo_usuario_id')); ?> :</b> <?php $valor = TipoUsuario::model()->findByPk($data->tipo_usuario_id); echo CHtml::link(CHtml::encode($valor->nombre), array('/tipoUsuario/' . $valor->id)); ?> <br /> <b><?php echo CHtml::encode($data->getAttributeLabel('carrera_departamento_id')); ?> :</b> <?php $valor = CarreraDepartamento::model()->findByPk($data->carrera_departamento_id); echo CHtml::link(CHtml::encode($valor->nombre), array('/carreraDepartamento/' . $valor->id)); ?> <br /> <br> </div>
echo $form->labelEx($model, 'tipo_usuario_id'); ?> <?php echo $form->dropDownList($model, 'tipo_usuario_id', CHtml::listData(TipoUsuario::model()->findAll(), 'id', 'nombre')); ?> <?php echo $form->error($model, 'tipo_usuario_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'carrera_departamento_id'); ?> <?php echo $form->dropDownList($model, 'carrera_departamento_id', CHtml::listData(CarreraDepartamento::model()->findAll(), 'id', 'nombre')); ?> <?php echo $form->error($model, 'carrera_departamento_id'); ?> </div> <div class="row buttons"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Crear' : 'Guardar'); ?> </div> <?php $this->endWidget(); ?>