Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Commit

Permalink
Update routing (#1707)
Browse files Browse the repository at this point in the history
Added a little description and list of events in router
  • Loading branch information
emiliodeg authored and niden committed Aug 16, 2018
1 parent c6c3b85 commit 77d4790
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions en/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
<li>
<a href="#annotations">Annotations Router</a>
</li>
<li>
<a href="#events">Events</a>
</li>
<li>
<a href="#registration">Registering Router instance</a>
</li>
Expand Down Expand Up @@ -1094,6 +1097,19 @@ foreach ($testRoutes as $testRoute) {
}
```

<a name='events'></a>
## Events
Like many other components, routers also have events. None of the events can stop the operation. Below is a list of available events

| Event | Description |
|----------------------------|--------------------------------------|
| `router:beforeCheckRoutes` | Fired before check all loaded routes |
| `router:beforeCheckRoute` | Fired before check a route |
| `router:matchedRoute` | Fired when a route is matched |
| `router:notMatchedRoute` | Fired is any route is matched |
| `router:afterCheckRoutes` | Fired after check all routes |
| `router:beforeMount` | Fired before mount a new route |

<a name='annotations'></a>
## Annotations Router
This component provides a variant that's integrated with the [annotations](/[[language]]/[[version]]/annotations) service. Using this strategy you can write the routes directly in the controllers instead of adding them in the service registration:
Expand Down

0 comments on commit 77d4790

Please sign in to comment.