/** * Creates a new Hoadon model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Hoadon(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->hoadon_id]); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new Hoadon model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Hoadon(); $list = Khachhang::find()->all(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect('http://localhost/basic/web/index.php?r=hoadon%2Findex'); } else { return $this->render('create', ['model' => $model, 'list' => $list]); } }