php - Symfony 1.4 - route by query string parameters -
is possible route request controllers/actions query string parameters? , how using routing.yml file?
i mean:
/some/path?do=action1... some_route: url: /some/path param: { module: module1, action: action1 } requirements: do: action1 <--- ??? /some/path?do=action2 some_route2 url: /some/path param: { module: module1, action: action2 } requirements: do: action2 <--- ???
or common route:
some_route: url: /some/path?do=:action param: { module: module1, action: action } requirements: do: action\d+
thanks!
yes, possible creating generic rule in routing.yml
:
generic_rule: url: /some/path/:action param: {module: yourmodule}
in case when call /some/path/index
indexaction
method of yourmodule
called.
you can create more generic rule, both action
, module
variables:
more_generic_rule: url: /some/path/:module/:action
check doc more info.
Comments
Post a Comment