Skip to content

Commit 457b016

Browse files
Nyholmdbu
authored andcommitted
Register routes sf 4.1 style (#270)
Register routes sf 4.1 style
1 parent a6466b4 commit 457b016

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Tests/Resources/app/AppKernel.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ protected function configureRoutes(RouteCollectionBuilder $routes)
5353
{
5454
$routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml', '/_wdt');
5555
$routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml', '/_profiler');
56-
$routes->add('/', 'kernel:indexAction');
56+
57+
if (Kernel::MAJOR_VERSION < 4 || (Kernel::MAJOR_VERSION === 4 && Kernel::MINOR_VERSION === 0)) {
58+
$routes->add('/', 'kernel:indexAction');
59+
} else {
60+
// If 4.1+
61+
$routes->add('/', 'kernel::indexAction');
62+
}
5763
}
5864

5965
/**

0 commit comments

Comments
 (0)