Documented cms.router.beforeRoute
This commit is contained in:
parent
900220b079
commit
1dc6f944ac
|
|
@ -79,6 +79,17 @@ class Router
|
||||||
$this->url = $url;
|
$this->url = $url;
|
||||||
$url = RouterHelper::normalizeUrl($url);
|
$url = RouterHelper::normalizeUrl($url);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @event cms.router.beforeRoute
|
||||||
|
* Fires before the CMS Router handles a route
|
||||||
|
*
|
||||||
|
* Example usage:
|
||||||
|
*
|
||||||
|
* Event::listen('cms.router.beforeRoute', function ((string) $url, (\Cms\Classes\Router) $thisRouterInstance) {
|
||||||
|
* return \Cms\Classes\Page::loadCached('trick-theme-code', 'page-file-name');
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
*/
|
||||||
$apiResult = Event::fire('cms.router.beforeRoute', [$url, $this], true);
|
$apiResult = Event::fire('cms.router.beforeRoute', [$url, $this], true);
|
||||||
if ($apiResult !== null) {
|
if ($apiResult !== null) {
|
||||||
return $apiResult;
|
return $apiResult;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue