/** * Creates a new Vendorproducts model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Vendorproducts(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->Pid]); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new Vendorproducts model. * If creation is successful, the browser will be redirected to the 'view' page. * * @return mixed */ public function actionCreate() { //$this->layout = "@app/views/layouts/vendor"; $this->layout = "@app/views/layouts/vendor_left"; $model = new Vendorproducts(); if ($model->load(Yii::$app->request->post())) { $model->vendorId = Yii::$app->user->id; $model->save(); return $this->redirect(['index']); } else { return $this->render('create', ['model' => $model]); } }