Skip to content

Commit 96df524

Browse files
committed
FIX README.md
1 parent ed3d55e commit 96df524

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ include 'src/Autload.php'
3838

3939
use MinusFour\Router\Action;
4040
use MinusFour\Router\Route;
41-
use MinusFour\Router\RouteContainer;
41+
use MinusFour\Router\TreeRouteContainer;
4242
use MinusFour\Router\Router;
4343
```
4444

@@ -75,13 +75,17 @@ $route->dispatch($_SERVER['REQUEST_METHOD'], strtok($_SERVER['REQUEST_URI'], '?'
7575

7676
It is possible to use regular expressions in some parts of the route. For example:
7777

78-
`$route = new Route('regex_route_example', '/section:(home|news)');`
78+
```php
79+
$route = new Route('regex_route_example', '/section:(home|news)');
80+
```
7981

8082
It will match /home or /news.
8183

8284
It's possible to mix in static elements as well.
8385

84-
`$route = new Route('regex_route_example_2', '/section/name:(home|news)');`
86+
```php
87+
$route = new Route('regex_route_example_2', '/section/name:(home|news)');
88+
```
8589

8690
Will match /section/home o /section/news.
8791

@@ -96,9 +100,11 @@ not the path itself.
96100

97101
You shouldn't use a slash in your expressions.
98102

99-
`$route = new Route('regex_route_bad_example', '/section:(home/news|home/forums)');`
103+
```php
104+
$route = new Route('regex_route_bad_example', '/section:(home/news|home/forums)');
105+
```
100106

101-
Will not work. It will create static childrens for news|home and forums and the first element will be tested for (home.
107+
Will not work. It will create static childrens for news|home, forums) and the first element will be tested for (home.
102108

103109
#### Multiple matches restriction
104110

@@ -111,8 +117,8 @@ $route2 = new Route('regex_common_route_2', '/route2:\d+'); //Matches numbers.
111117
```
112118

113119
And the path to be matched is: /123456. Only the first one will be matched, it will not even attempt to try out
114-
the second expression as there's already one that fits plus there's no way the Router could now the other one
115-
is the valid one, even though is a more restrictive expression.
120+
the second expression as there's already one that fits plus there's no way the Router could know the other one
121+
is the valid one, even though it's a more restrictive expression.
116122

117123
## HOWEVER
118124

@@ -136,5 +142,5 @@ It will behave like this:
136142
When the router fails to match a Route, it will throw a `RouteNotFoundException`. If it fails to find an action for
137143
the specified method, it will throw a `MethodNotFoundException`. Both can be caught under a `NotFoundException`.
138144

139-
`RouteNotFoundException` and `MethodNotFoundException` both live under `/MinusFour/Router` while `NotFoundException`
145+
`RouteNotFoundException` and `MethodNotFoundException` live under `MinusFour/Router` while `NotFoundException`
140146
is under `MinusFour\Utils`.

0 commit comments

Comments
 (0)