Skip to content

Commit

Permalink
Load routes for specific env first
Browse files Browse the repository at this point in the history
It's common to add a 'wildcard' route to an application that looks like
a CMS. Usually the route has the following path `/{slug}`.

But with the current routes loading order, the 'dev' routing is loaded
after regular routes. In previous SF versions, dev routing was loaded
first. This PR retores this behavior.
  • Loading branch information
lyrixx committed Feb 25, 2019
1 parent 3115302 commit 52c6d2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion symfony/framework-bundle/4.2/src/Kernel.php
Expand Up @@ -41,8 +41,8 @@ protected function configureRoutes(RouteCollectionBuilder $routes)
{
$confDir = $this->getProjectDir().'/config';

$routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');
}
}

0 comments on commit 52c6d2a

Please sign in to comment.