Skip to content

Commit d529fc9

Browse files
committed
RoutingExtension: creates service 'routes' when no other exists WIP
for BC compatibility with tests
1 parent 77fe910 commit d529fc9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/Bridges/ApplicationDI/RoutingExtension.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ public function beforeCompile()
8282
new Definitions\Statement(Nette\Bridges\ApplicationTracy\RoutingPanel::class),
8383
]);
8484
}
85+
86+
if (!$builder->getByType(Nette\Routing\Router::class)) {
87+
$builder->addDefinition($this->prefix('router'))
88+
->setType(Nette\Routing\Router::class)
89+
->setFactory(Nette\Routing\SimpleRouter::class);
90+
$builder->addAlias('router', $this->prefix('router'));
91+
}
8592
}
8693

8794

0 commit comments

Comments
 (0)