I have an application already done with Symfony2 framework.
The current rooting in the app lok like that :
http://testserver.loca.com/app_dev.php/Dashboard/
I would like to Add a dynamic prefix like that :
http://testserver.loca.com/app_dev.php/Prefix/Dashboard/
the dynamic Prefix will be chosen by the user when he click on a link that will send him directly to the Specific Page, the list will look like:
http://testserver.loca.com/app_dev.php/Prefix1/Dashboard/
http://testserver.loca.com/app_dev.php/Prefix2/Dashboard/
http://testserver.loca.com/app_dev.php/Prefix3/Dashboard/
I found around that there are a possibility to do it with a Service and an ExtraLoader Class, but i realdon’t know how to get this done.
You could handle the prefix in the routing:
In the above, the route has a place holder for prefix which is passed to the
dynamicDashboardAction($prefix)method. In the view, you can use twig to pass the correct prefix from each link: