public function actionCreatesubhead() { $subheadModel = new LedgerSubhead(); $subheadModel->attributes = $_POST['LedgerSubhead']; if ($subheadModel->save()) { Yii::$app->getSession()->setFlash('success', 'Subhead has been added successfully'); return $this->redirect(['index']); } }