Esempio n. 1
0
 public function postthemdanhmuc(HangXeRequest $request)
 {
     $brand = new Brand();
     $brand->hang_name = $request->hang_name;
     $brand->save();
     return redirect('danhmuc');
 }
Esempio n. 2
0
 /**
  * Creates a new Brand model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Brand();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->brand_id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }