Example #1
0
<div class="col-md-12">
    <div class="grid simple">

        <div class="grid-body no-border"> <br>
            <div class="row">
                <div class="kuis-form">

                    <?php 
$form = ActiveForm::begin();
?>


                    <div class="form-group field-kuis-tutorial_id">
                        <label class="control-label" for="kuis-tutorial_id">Kategori Kuis</label>
                        <?php 
echo Html::activeDropDownList($model, 'kuis_category_id', ArrayHelper::map(\app\models\KuisCategory::find()->all(), 'id', 'kuis_category_name'), ['prompt' => 'Pilih Kategori Kuis']);
?>

                        <div class="help-block"></div>
                    </div>


                    <?php 
echo $form->field($model, 'kuis_name')->textInput(['maxlength' => true]);
?>

                    <?php 
echo $form->field($model, 'description')->textarea(['rows' => 6]);
?>

 /**
  * Finds the KuisCategory model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return KuisCategory the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = KuisCategory::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }