Load routes for specific env first

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.
This commit is contained in:
Grégoire Pineau
2019-02-25 16:29:14 +01:00
parent 3115302cca
commit 52c6d2ae96
+1 -1
View File
@@ -41,8 +41,8 @@ class Kernel extends BaseKernel
{
$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');
}
}