/** * 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 Vacuna the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Vacuna::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'Fecha', 'themeUrl' => Yii::app()->baseUrl . '/css/jui', 'theme' => 'softark', 'cssFile' => 'jquery-ui-1.9.2.custom.css', 'options' => array('showOn' => 'both', 'dateFormat' => 'yy-mm-dd', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeYear' => true, 'changeMonth' => true, 'yearRange' => '1950:2099', 'minDate' => '1950-01-01', 'maxDate' => '2099-12-31', 'showButtonPanel' => true), 'htmlOptions' => array('size' => '10', 'maxlength' => '10', 'placeholder' => 'aaaa-mm-dd'))); ?> <?php echo $form->error($model, 'Fecha'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'Vacuna_idVacuna'); ?> <?php echo $form->dropDownList($model, 'Vacuna_idVacuna', CHtml::listData(Vacuna::model()->findAll(), 'idVacuna', 'Nombre'), array('empty' => 'Nombre de la Vacuna')); ?> <?php echo $form->error($model, 'Vacuna_idVacuna'); ?> </div> <div class="row buttons"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Aceptar' : 'Save'); ?> </div> <?php $this->endWidget(); ?>