/** * 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 TipeProfil the loaded model * @throws CHttpException */ public function loadModel($id) { $model = TipeProfil::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
$form = $this->beginWidget('CActiveForm', array( 'id' => 'profil-form', // Please note: When you enable ajax validation, make sure the corresponding // controller action is handling ajax validation correctly. // There is a call to performAjaxValidation() commented in generated controller code. // See class documentation of CActiveForm for details on this. 'enableAjaxValidation' => false, )); ?> <?php echo $form->errorSummary($model, 'Error: Perbaiki input', null, array('class' => 'panel callout')); ?> <div class="row"> <div class="small-12 columns"> <?php echo $form->labelEx($model, 'tipe_id'); ?> <?php echo $form->dropDownList($model, 'tipe_id', CHtml::listData(TipeProfil::model()->findAll(), 'id', 'nama')); ?> <?php echo $form->error($model, 'tipe_id', array('class' => 'error')); ?> </div> </div> <div class="row"> <div class="small-12 columns"> <?php echo $form->labelEx($model, 'nama'); ?> <?php echo $form->textField($model, 'nama', array('size' => 60, 'maxlength' => 100)); ?> <?php echo $form->error($model, 'nama', array('class' => 'error')); ?> </div> </div> <hr> <div class="row"> <div class="small-12 medium-6 columns"> <?php echo $form->labelEx($model, 'nomor'); ?>
public function getNamaTipe() { $tipeProfil = TipeProfil::model()->findByPk($this->tipe_id); return $tipeProfil->nama; }