class MenuTokenSubscriber in Menu Token 8
Same name and namespace in other branches
- 9.1.x src/EventSubscriber/MenuTokenSubscriber.php \Drupal\menu_token\EventSubscriber\MenuTokenSubscriber
Event Subscriber MenuTokenSubscriber.
Hierarchy
- class \Drupal\menu_token\EventSubscriber\MenuTokenSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of MenuTokenSubscriber
1 string reference to 'MenuTokenSubscriber'
1 service uses MenuTokenSubscriber
File
- src/
EventSubscriber/ MenuTokenSubscriber.php, line 13
Namespace
Drupal\menu_token\EventSubscriberView source
class MenuTokenSubscriber implements EventSubscriberInterface {
protected $currentUser;
protected $cache;
protected $contextRepository;
protected $menuTokenContextManager;
/**
* MenuTokenSubscriber constructor.
*
* @param \Drupal\menu_token\Service\MenuTokenContextManager $menuTokenContextManager
* Menu token context manager.
*/
public function __construct(MenuTokenContextManager $menuTokenContextManager) {
$this->menuTokenContextManager = $menuTokenContextManager;
}
/**
* The CONTROLLER event occurs once a controller was found.
*
* @param \Symfony\Component\HttpKernel\Event\FilterControllerEvent $event
* The controller event.
*
* For handling a request. Constant KernelEvents::CONTROLLER.
*/
public function onController(FilterControllerEvent $event) {
$this->menuTokenContextManager
->replaceContextualLinks();
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[KernelEvents::CONTROLLER][] = [
'onController',
];
return $events;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MenuTokenSubscriber:: |
protected | property | ||
MenuTokenSubscriber:: |
protected | property | ||
MenuTokenSubscriber:: |
protected | property | ||
MenuTokenSubscriber:: |
protected | property | ||
MenuTokenSubscriber:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
MenuTokenSubscriber:: |
public | function | The CONTROLLER event occurs once a controller was found. | |
MenuTokenSubscriber:: |
public | function | MenuTokenSubscriber constructor. |