Skip to content

Commit 8393433

Browse files
committed
RoutingExtension: creates service 'routes' when no other exists WIP
for BC compatibility with tests
1 parent 4bdf0c8 commit 8393433

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
@@ -85,6 +85,13 @@ public function beforeCompile()
8585
new Definitions\Statement(Nette\Bridges\ApplicationTracy\RoutingPanel::class),
8686
]);
8787
}
88+
89+
if (!$builder->getByType(Nette\Routing\Router::class)) {
90+
$builder->addDefinition($this->prefix('router'))
91+
->setType(Nette\Routing\Router::class)
92+
->setFactory(Nette\Routing\SimpleRouter::class);
93+
$builder->addAlias('router', $this->prefix('router'));
94+
}
8895
}
8996

9097

0 commit comments

Comments
 (0)