diff --git a/blog/config/common/di/router.php b/blog/config/common/di/router.php index d192a6d1..0d43eab1 100644 --- a/blog/config/common/di/router.php +++ b/blog/config/common/di/router.php @@ -11,7 +11,10 @@ use Yiisoft\Router\RouteCollectorInterface; use Yiisoft\Yii\Debug\Viewer\Middleware\ToolbarMiddleware; -/** @var Config $config */ +/** + * @var Config $config + * @var array $params + */ return [ RouteCollectionInterface::class => static function (RouteCollectorInterface $collector) use ($config) { @@ -19,8 +22,12 @@ ->middleware(CsrfMiddleware::class) ->middleware(FormatDataResponse::class) ->addGroup( - Group::create('/{_language}') + Group::create() ->routes(...$config->get('routes')) + ) + ->addGroup( + Group::create('/{_language}') + ->routes(...$config->get('app-routes')) ); if (!str_starts_with(getenv('YII_ENV') ?: '', 'prod')) { diff --git a/blog/configuration.php b/blog/configuration.php index 20520fe0..918ce8a4 100644 --- a/blog/configuration.php +++ b/blog/configuration.php @@ -44,7 +44,7 @@ '$events', 'console/events.php', ], - 'routes' => [ + 'app-routes' => [ 'common/routes/*.php', ], 'bootstrap' => [