SyliusFlowBundle - how to make url parameters follows from step to step

93 views
Skip to first unread message

DanaKil

unread,
Apr 11, 2014, 12:21:35 PM4/11/14
to syl...@googlegroups.com
Hello,
I'm using SyliusFlowBundle. I want to do a "flow" with a route like:

/{productId}/flow/step1,
/{productId}/flow/step2 ...

My routing:
esr_cart_path_start:
    pattern: /{productId}/
    defaults: { _controller: sylius.controller.process:startAction, scenarioAlias: 'esr_cart_path' }
esr_cart_path_display:
    pattern: /{productId}/{stepName}
    defaults: { _controller: sylius.controller.process:displayAction, scenarioAlias: 'esr_cart_path' }
esr_cart_path_forward:
    pattern: /{productId}/{stepName}/forward
    defaults: { _controller: sylius.controller.process:forwardAction, scenarioAlias: 'esr_cart_path' }

When I submit the first step, I have an error saying "Some mandatory parameters are missing ("productId") to generate a URL for route "esr_cart_path_display".
I can't define some paramters to inject in the "esr_cart_path_display" route is generated for the next step (or I don't know how...)

Any hint please ?

Maya Shah

unread,
Feb 15, 2016, 5:54:33 AM2/15/16
to Sylius
You have to inform to sylius flow to use custom parameter.

In Builder method add

     $builder->setDisplayRouteParams(['productId' => {get id from request}]);
     $builder->setForwardRouteParams(['productId' => {get id from request}]);

Also you need to set productId to action of form in step file.
Reply all
Reply to author
Forward
0 new messages