Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automate function name in symfony routing?

Here is the simple route defined in the custom bundle

my_admin_route:
    pattern:  /admin/{name}
    defaults: { _controller: NamespaceCustomBundle:CustomControl:login }

Above routing code will call the CustomControlController's method loginAction() my question is how can i automate the function name in routing like for each function i don't have to define the route again there should be one route and call the function automatically as defined parameter {name} in the route like below

my_admin_route:
    pattern:  /admin/{name}
    defaults: { _controller: NamespaceCustomBundle:CustomControl:{name} }
like image 690
M Khalid Junaid Avatar asked Sep 22 '13 13:09

M Khalid Junaid


1 Answers

you can look at KNP Rad Bundle: http://rad.knplabs.com/

It does a lot of good things including the one you are talking about

like image 112
Shaheer Avatar answered Sep 18 '22 00:09

Shaheer