?> <?php echo $form->checkbox($model, 'minimum'); ?> <?php echo $form->error($model, 'minimum'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'school_year_id'); ?> <?php echo $form->dropDownList($model, 'school_year_id', CHtml::listData(SchoolYear::model()->findAll(), 'id', 'description')); ?> <?php echo $form->error($model, 'school_year_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'note'); ?> <?php echo $form->textField($model, 'note', array('size' => 60, 'maxlength' => 256)); ?> <?php echo $form->error($model, 'note');
/** * 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. */ public function loadModel() { if ($this->_model === null) { if (isset($_GET['id'])) { $this->_model = SchoolYear::model()->findbyPk($_GET['id']); } if ($this->_model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } } return $this->_model; }
<?php $form = $this->beginWidget('CActiveForm', array('id' => 'class-session-form', 'enableAjaxValidation' => false)); ?> <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, 'school_year_id'); ?> <?php echo $form->dropDownList($model, 'school_year_id', CHtml::listData(SchoolYear::model()->findAll(array('order' => 'start_date DESC')), 'id', 'description')); ?> <?php echo $form->error($model, 'school_year_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'description'); ?> <?php echo $form->textField($model, 'description', array('size' => 60, 'maxlength' => 128)); ?>