Open
Description
Description
Currently is no way to configure trailingSlashOnRoot via CollectionConfigurator. I'm suggest to add such argument to \Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator::prefix
// config/routes.php
<?php declare(strict_types=1);
use App\Controller\LuckyController;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
return function (RoutingConfigurator $routes): void {
$luckyNumberGroup = $routes->collection()->prefix(
'lucky-number',
// missing argument trailingSlashOnRoot
);
$luckyNumberGroup->add('lucky-number-view', '')
->controller([LuckyController::class, 'view'])
->methods(['GET']);
$luckyNumberGroup->add('lucky-number-add', '')
->controller([LuckyController::class, 'create'])
->methods(['POST']);
};
However trailingSlashOnRoot argument available via $routes->import()->prefix('lucky-number', trailingSlashOnRoot: false)
\Symfony\Component\Routing\Loader\Configurator\ImportConfigurator::prefix
final public function prefix(string|array $prefix, bool $trailingSlashOnRoot = true): static
Example
No response