Exemple #1
0
 /**
  * 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 = SubUnsur::model()->findbyPk($_GET['id']);
         }
         if ($this->_model === null) {
             throw new CHttpException(404, 'The requested page does not exist.');
         }
     }
     return $this->_model;
 }
Exemple #2
0
echo $form->labelEx($model, 'nama');
?>
        <?php 
echo $form->textField($model, 'nama', array('size' => 60, 'maxlength' => 255));
?>
        <?php 
echo $form->error($model, 'nama');
?>
    </div>

    <div class="row">
        <?php 
echo $form->labelEx($model, 'sub_unsur_id');
?>
        <?php 
echo $form->dropDownList($model, 'sub_unsur_id', CHtml::listData(SubUnsur::model()->findAll(), 'id', 'subUnsurOption'));
?>
        <?php 
echo $form->error($model, 'sub_unsur_id');
?>
    </div>

    <div class="row buttons">
        <?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
    </div>

<?php 
$this->endWidget();
?>