/** * 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 = JenisDupak::model()->findbyPk($_GET['id']); } if ($this->_model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } } return $this->_model; }
<?php echo $form->textField($dupak, 'mp_mulai', array('size' => 12, 'maxlength' => 10)); ?> s/d <?php echo $form->textField($dupak, 'mp_selesai', array('size' => 12, 'maxlength' => 10)); ?> </div> <div class="row"> <?php echo $form->labelEx($dupak, 'jenis_dupak_id'); ?> <?php echo $form->dropDownList($dupak, 'jenis_dupak_id', CHtml::listData(JenisDupak::model()->findAll(), 'id', 'nama')); ?> <?php echo $form->error($dupak, 'jenis_dupak_id'); ?> </div> <div class="row buttons"> <?php echo Chtml::link('<button>Back</button>', array('ktiItem/create')); ?> <?php echo CHtml::submitButton('Next'); ?> </div>