Skip to content
Permalink
Browse files

RouterFactory: uses Nette 3 routing

  • Loading branch information...
dg committed Feb 10, 2019
1 parent 427d37f commit 4ce0a4b3ed9de52d2be48ae211354e6dc17c43e7
Showing with 7 additions and 7 deletions.
  1. +2 −2 CD-collection/app/Booting.php
  2. +5 −5 Modules-Usage/app/Booting.php
@@ -32,8 +32,8 @@ public static function boot(): Configurator
// Setup router using mod_rewrite detection
if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules(), true)) {
$router = new RouteList;
$router[] = new Route('index.php', 'Dashboard:default', Route::ONE_WAY);
$router[] = new Route('<presenter>/<action>[/<id>]', 'Dashboard:default');
$router->addRoute('index.php', 'Dashboard:default', Route::ONE_WAY);
$router->addRoute('<presenter>/<action>[/<id>]', 'Dashboard:default');
} else {
$router = new SimpleRouter('Dashboard:default');
@@ -32,13 +32,13 @@ public static function boot(): Configurator
// Setup router using mod_rewrite detection
if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules(), true)) {
$router = new RouteList;
$router[] = new Route('index.php', 'Front:Default:default', Route::ONE_WAY);
$router->addRoute('index.php', 'Front:Default:default', Route::ONE_WAY);
$router[] = $adminRouter = new RouteList('Admin');
$adminRouter[] = new Route('admin/<presenter>/<action>', 'Default:default');
$router->withModule('Admin')
->addRoute('admin/<presenter>/<action>', 'Default:default');
$router[] = $frontRouter = new RouteList('Front');
$frontRouter[] = new Route('<presenter>/<action>[/<id>]', 'Default:default');
$router->withModule('Front')
->addRoute('<presenter>/<action>[/<id>]', 'Default:default');
} else {
$router = new SimpleRouter('Front:Default:default');

0 comments on commit 4ce0a4b

Please sign in to comment.
You can’t perform that action at this time.