<p class="note">Fields with <span class="required">*</span> are required.</p> <?php echo $form->errorSummary($model); ?> <div class="row"> <?php echo $form->labelEx($model, 'citta_id'); ?> <?php //echo $form->textField($model,'citta_id',array('size'=>60,'maxlength'=>100)); ?> <?php echo $form->dropDownList($model, 'citta_id', CHtml::listData(Citta::model()->findAll(), 'id', 'nome'), array('empty' => 'Seleziona citta')); ?> <?php echo $form->error($model, 'citta_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'nome'); ?> <?php echo $form->textField($model, 'nome', array('size' => 60, 'maxlength' => 255)); ?> <?php echo $form->error($model, 'nome');
/** * 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 = Citta::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }