Generate well formed routes from MenuBuilder class in Symfony2

159 views Asked by At

I've this route defined in a controller:

/**
 * @Secure(roles="IS_AUTHENTICATED_FULLY")
 * @Route(
 *        "/proccess/{slug}", 
 *        requirements={"slug": "^([a-zA-Z0-9]*-[a-zA-Z0-9]*)+$"}, 
 *        name="registerRPNI"
 * )
 */
public function indexAction(Request $request)
{
    ......
}

And I need to set the right route in KNPMenuBundle MenuBuilder class. I'm doing as follow:

->addChild('Process RPNI', array(
     'uri' => '/process/national-and-imported-products-registration',
))

And it works for dev environment since route shows the right page and execute the right code but if I move away from dev and goes live to prod then I got a 404 Not found, what I'm doing wrong in this case? What should be the right way to generate the routes inside the MenuBuilder class? Any advice around this?

0

There are 0 answers