We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe95ea5 commit 40c884eCopy full SHA for 40c884e
src/Web/Router.php
@@ -21,6 +21,9 @@ class Router implements RouterInterface
21
public function __construct()
22
{
23
$this->defaultNamespaceName = "App\\Controllers\\";
24
+
25
+ // default routes
26
+ $this->map('/', [], '*');
27
}
28
29
/**
@@ -136,10 +139,6 @@ public function dispatch($uri = null)
136
139
protected function createDispatcher()
137
140
138
141
return $this->dispatcher ?: \FastRoute\simpleDispatcher(function (\FastRoute\RouteCollector $r) {
- // 默认路由
- if (!isset($this->routes['/'])) {
- $this->map('/', [], '*');
142
- }
143
foreach ($this->routes as $pattern => $route) {
144
$r->addRoute($route['methods'], $pattern, $route['handler']);
145
0 commit comments