public function actionCreate()
    {
        $model = new WarehouseVoucherItems();

        if ($model->loadAll(request()->post()) && $model->saveAll()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }
public function actionCreate()
    {
        $model = new WarehouseVoucherItems();

        if ($model->loadAll(request()->post()) && $model->saveAll()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }
public function actionCreate ( ) { $ model = new WarehouseVoucherItems ( ) ; if ( $ model -> loadAll ( request ( ) -> post ( ) ) && $ model -> saveAll ( ) ) { return $ this -> redirect ( [ 'view' , 'id' => $ model -> id ] ) ; } else { return $ this -> render ( 'create' , [ 'model' => $ model , ] ) ; } }
Creates a new WarehouseVoucherItems model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new WarehouseVoucherItems model . If creation is successful the browser will be redirected to the view page .