When using a route group with prefix defined as "/console" the routes attached to this group still must contain it.
protected function configureRouteGroups(GroupRegistry $groups): void
{
$groups->getGroup('console:user')
->setNamePrefix('/console')
->setPrefix('/console');
}
protected function defineRoutes(RoutingConfigurator $routes): void
{
$consoleUserRoutes = [
// ...
'/project/search' => [ProjectController::class, 'search'],
// ...
];
foreach ($consoleUserRoutes as $path => $target) {
$routes->add($path, $path)
->group('console:user')
->methods('POST')
->action($target[0], $target[1]);
}
}
The code above doesn't work and I have to do this:
$consoleUserRoutes = [
// ...
'/console/project/search' => [ProjectController::class, 'search'],
// ...
];
or this:
$routes->add($path, $path)
->prefix('/console')
->group('console:user')
->methods('POST')
->action($target[0], $target[1]);
Spiral Framework version: 3.15.3
When using a route group with prefix defined as "/console" the routes attached to this group still must contain it.
The code above doesn't work and I have to do this:
or this:
Spiral Framework version: 3.15.3