class EventSubscriber in Fast Autocomplete 8
Class EventSubscriber.
Subscribes to the alter_excluded_paths event from the stage_file_proxy module to exclude the path for the json files of the fac module.
@package Drupal\fac\EventSubscriber
Hierarchy
- class \Drupal\fac\EventSubscriber\EventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of EventSubscriber
1 string reference to 'EventSubscriber'
1 service uses EventSubscriber
File
- src/
EventSubscriber/ EventSubscriber.php, line 17
Namespace
Drupal\fac\EventSubscriberView source
class EventSubscriber implements EventSubscriberInterface {
/**
* Register events and callbacks.
*
* @return array
* The array of registered events with callbacks.
*/
public static function getSubscribedEvents() {
$events['stage_file_proxy.alter_excluded_paths'][] = [
'alterExcludedPaths',
0,
];
return $events;
}
/**
* The excluded paths event callback.
*
* @param object $event
* The event.
*/
public function alterExcludedPaths($event) {
$excluded_paths = $event
->getExcludedPaths();
$excluded_paths[] = PublicStream::basePath() . '/fac-json';
$event
->setExcludedPaths($excluded_paths);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EventSubscriber:: |
public | function | The excluded paths event callback. | |
EventSubscriber:: |
public static | function | Register events and callbacks. |