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); }
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']); }