class PurlContextOutboundRouteProcessor in Persistent URL 8
Hierarchy
- class \Drupal\purl\RouteProcessor\PurlContextOutboundRouteProcessor implements \Symfony\Component\EventDispatcher\EventSubscriberInterface, OutboundRouteProcessorInterface
Expanded class hierarchy of PurlContextOutboundRouteProcessor
1 string reference to 'PurlContextOutboundRouteProcessor'
1 service uses PurlContextOutboundRouteProcessor
File
- src/
RouteProcessor/ PurlContextOutboundRouteProcessor.php, line 21
Namespace
Drupal\purl\RouteProcessorView source
class PurlContextOutboundRouteProcessor implements OutboundRouteProcessorInterface, EventSubscriberInterface {
/**
* @var MethodPluginManager
*/
private $manager;
/**
* @var ModifierMatchedEvent[]
*/
private $events = array();
public function __construct(MethodPluginManager $manager) {
$this->manager = $manager;
}
public function processOutbound($route_name, Route $route, array &$parameters, BubbleableMetadata $bubbleable_metadata = NULL) {
foreach ($this->events as $event) {
$method = $this->manager
->getMethodPlugin($event
->getMethod());
if ($method instanceof OutboundRouteAlteringInterface) {
$path = $method
->alterOutboundRoute($route_name, $event
->getModifier(), $route, $parameters, $bubbleable_metadata);
}
}
}
public function onModifierMatched(ModifierMatchedEvent $event) {
$this->events[] = $event;
}
public static function getSubscribedEvents() {
return [
PurlEvents::MODIFIER_MATCHED => array(
'onModifierMatched',
300,
),
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PurlContextOutboundRouteProcessor:: |
private | property | ||
PurlContextOutboundRouteProcessor:: |
private | property | ||
PurlContextOutboundRouteProcessor:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
PurlContextOutboundRouteProcessor:: |
public | function | ||
PurlContextOutboundRouteProcessor:: |
public | function |
Processes the outbound route. Overrides OutboundRouteProcessorInterface:: |
|
PurlContextOutboundRouteProcessor:: |
public | function |