I'm updating from Symfony 4 to Symfony 5.4. One of the changes to the Framework Bundle is RouteCollectionBuilder
being deprecated in favour of RoutingConfigurator
. But the problem is that I used to set default requirements for the routes like this:
$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob');
$routes->setRequirement('_locale', 'ru|en|ua|es|fr|pl|de|pt|it|be');
But new RoutingConfigurator
does not have any method which replaces setRequirement
. How can I define global/default requirements for all routes with the new configurator?
The other thing is that prefix
argument is also disappeared, so I need to somehow use prefix for the whole route groups (I used to have 3 different route groups with different prefixes).