Just imagine, I have a controller with several actions. And in order to achieve each action, I have to define it strictly in the routing.yml file as follows:
admin_edit_routes:
pattern: /administrator/edituser
defaults: { _controller: MyAdminBundle:Default:edituser }
admin_add_routes:
pattern: /administrator/adduser
defaults: { _controller: MyAdminBundle:Default:adduser }
And I can have many such pages. What I want to achieve is to define the necessary actions in my URI, as the Kohana routes do. I mean, I just want to use one route for all actions: (the code below is not valid, for example)
admin_main_route:
pattern: /administrator/{action}
defaults: { _controller: MyAdminBundle:Default:{action} action:index}
It will send all requests to / administrator / {anything} to this route, and then, according to the action specified in the uri, the necessary action will be called. If no action is specified in the uri, then we get an indexing action.
Is this possible in Symfony 2 anyway, and if so, how? Thanking in advance.