예제 #1
0
 public function actionNew()
 {
     $model = new TemplateForm();
     if (isset($_POST["TemplateForm"])) {
         $model->attributes = $_POST["TemplateForm"];
         if ($model->save()) {
             $this->flash('Data Berhasil Disimpan');
             $this->redirect(['index']);
         }
     }
     $this->renderForm("TemplateForm", $model);
 }
예제 #2
0
 public function actionInsertRelModel()
 {
     $model = new TemplateForm();
     $posted = false;
     if (isset($_POST["TemplateForm"])) {
         $model->attributes = $_POST["TemplateForm"];
         if ($model->save()) {
             $posted = true;
         }
     }
     $this->renderForm("TemplateForm", $model, ['inserted' => $model->{$model->tableSchema->primaryKey}, 'posted' => $posted], ['layout' => '//layouts/blank']);
 }