EventListener.php in Facets 8
Namespace
Drupal\facets_events_testFile
tests/facets_events_test/src/EventListener.phpView source
<?php
namespace Drupal\facets_events_test;
use Drupal\facets\Event\QueryStringCreated;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* Class EventListener.
*/
class EventListener implements EventSubscriberInterface {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
return [
QueryStringCreated::NAME => 'queryStringCreated',
];
}
/**
* Event handler for the query string created event.
*
* @param \Drupal\facets\Event\QueryStringCreated $event
* The query string created event.
*/
public function queryStringCreated(QueryStringCreated $event) {
$event
->getQueryParameters()
->add([
'test' => 'fun',
]);
}
}
Classes
Name![]() |
Description |
---|---|
EventListener | Class EventListener. |