mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 13:24:41 +03:00
Describe "routesAlter" event in Events class
This commit is contained in:
parent
7eea7c09d4
commit
c2f0fb24c3
@ -230,6 +230,18 @@ final class Events
|
||||
*/
|
||||
const RESOURCE_NOT_FOUND = 'resourceNotFound';
|
||||
|
||||
/**
|
||||
* Routes collection is loaded and ready to use.
|
||||
*
|
||||
* This event is triggered after all routes are loaded. It provides an
|
||||
* ability for plugins to alter routes collection before it will be used. An
|
||||
* associative array with the following items is passed to the event
|
||||
* handlers:
|
||||
* - "routes" an instance of
|
||||
* {@link Symfony\Component\Routing\RouteCollection} class.
|
||||
*/
|
||||
const ROUTES_ALTER = 'routesAlter';
|
||||
|
||||
/**
|
||||
* Thread is updated.
|
||||
*
|
||||
|
@ -21,6 +21,7 @@ namespace Mibew\Routing;
|
||||
|
||||
use Mibew\Plugin\Manager as PluginManager;
|
||||
use Mibew\EventDispatcher\EventDispatcher;
|
||||
use Mibew\EventDispatcher\Events;
|
||||
use Symfony\Component\Routing\Loader\YamlFileLoader;
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
use Symfony\Component\Config\FileLocatorInterface;
|
||||
@ -91,7 +92,7 @@ class RouteCollectionLoader
|
||||
|
||||
// Add an ability for plugins to alter routes list
|
||||
$arguments = array('routes' => $collection);
|
||||
EventDispatcher::getInstance()->triggerEvent('routesAlter', $arguments);
|
||||
EventDispatcher::getInstance()->triggerEvent(Events::ROUTES_ALTER, $arguments);
|
||||
|
||||
return $arguments['routes'];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user