Answer the question
In order to leave comments, you need to log in
Generalize rules for routes?
<route id="logout" methods="GET" schemes="HTTPS" path="logout" />
<route id="login" methods="POST|GET" schemes="HTTPS" path="{_locale}/login"
controller="here_goes_some_very_long_path_to_controller_LogInController::authenticate"/>
<route id="dashboard" methods="GET" schemes="HTTPS" path="{_locale}/"
controller="here_goes_some_very_long_path_to_controller_DashboardController::index"/>
<route id="dashboard_default" methods="GET" schemes="HTTPS" path="/"
controller="here_goes_some_very_long_path_to_controller_DashboardController::index"/>
Answer the question
In order to leave comments, you need to log in
If you need to apply the configuration to a group of routes, you need to put them in a separate file and import them. You can see an example in the demo application (there is YAML, but everything is exactly the same for XML): https://github.com/symfony/demo/blob/master/config... Shortening
paths to controllers in a simple way will not work. However, you can try creating your own route loader: https://symfony.com/doc/current/routing/custom_rou...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question