From 77d4790db4983e41e8f6b8b1c8dac7f0e6dcf5a7 Mon Sep 17 00:00:00 2001 From: Degiovanni Emilio Date: Thu, 16 Aug 2018 10:14:37 -0300 Subject: [PATCH] Update routing (#1707) Added a little description and list of events in router --- en/routing.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/en/routing.md b/en/routing.md index def23a40fa27..7549bdeb0b22 100644 --- a/en/routing.md +++ b/en/routing.md @@ -68,6 +68,9 @@
  • Annotations Router
  • +
  • + Events +
  • Registering Router instance
  • @@ -1094,6 +1097,19 @@ foreach ($testRoutes as $testRoute) { } ``` + +## 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 | + ## 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: