/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate($id = 0) { $model = new AccHist(); $model->account_id = (int) $id; if ($model->load(Yii::$app->request->post())) { if ($model->save()) { if (!$this->hasCallback()) { $this->redirect(array('view', 'id' => $model->id)); } } } return $this->render('create', array('model' => $model)); }