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