Exemplo n.º 1
0
 /**
  * Creates a new ItemProp model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @param $categoryId
  * @return mixed
  */
 public function actionCreate($categoryId)
 {
     $model = Kiwi::getItemProp(['category_id' => $categoryId]);
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['category/index']);
     } else {
         return $this->render('create', ['model' => $model, 'category' => Kiwi::getCategory()->findOne($categoryId)]);
     }
 }
Exemplo n.º 2
0
 /**
  * Creates a new PropValue model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @param $itemPropId
  * @return mixed
  */
 public function actionCreate($itemPropId)
 {
     $model = Kiwi::getPropValue(['item_prop_id' => $itemPropId]);
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['item-prop/update', 'id' => $model->item_prop_id]);
     } else {
         return $this->render('create', ['model' => $model, 'itemProp' => Kiwi::getItemProp()->findOne($itemPropId)]);
     }
 }