@@ -70,7 +70,7 @@ |
||
| 70 | 70 | |
| 71 | 71 | if (!empty($route->getWhere())) { |
| 72 | 72 | foreach ($route->getWhere() as $attribute => $where) { |
| 73 | - $path = preg_replace('#{('.$attribute.')}#', '('.$where.')', $path); |
|
| 73 | + $path = preg_replace('#{(' . $attribute . ')}#', '(' . $where . ')', $path); |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | $path = preg_replace("#{([\w]+)}#", '([^/]+)', $path); |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | $router = new Router(); |
| 8 | 8 | |
| 9 | 9 | $router->get('/home/{id}/{foo}', 'home', function ($id) { |
| 10 | - echo 'hi from home ' . $id; |
|
| 10 | + echo 'hi from home ' . $id; |
|
| 11 | 11 | })->where(['id' => '[0-9]+']); |
| 12 | 12 | |
| 13 | 13 | $request = \GuzzleHttp\Psr7\ServerRequest::fromGlobals(); |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | $router = new Router(); |
| 8 | 8 | |
| 9 | -$router->get('/home/{id}/{foo}', 'home', function ($id) { |
|
| 9 | +$router->get('/home/{id}/{foo}', 'home', function($id) { |
|
| 10 | 10 | echo 'hi from home ' . $id; |
| 11 | 11 | })->where(['id' => '[0-9]+']); |
| 12 | 12 | |