You are here

public function ExamplePreprocessEventFactory::createEvent in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x examples/preprocess_example_module/src/Factory/ExamplePreprocessEventFactory.php \Drupal\preprocess_example_module\Factory\ExamplePreprocessEventFactory::createEvent()

Create the PreprocessEvent with the Variables object embedded.

Parameters

array $variables: Variables.

Return value

\Drupal\preprocess_event_dispatcher\Event\AbstractPreprocessEvent Created event.

Overrides PreprocessEventFactoryInterface::createEvent

File

examples/preprocess_example_module/src/Factory/ExamplePreprocessEventFactory.php, line 24

Class

ExamplePreprocessEventFactory
Class ExamplePreprocessEventFactory.

Namespace

Drupal\preprocess_example_module\Factory

Code

public function createEvent(array &$variables) : AbstractPreprocessEvent {
  return new ExamplePreprocessEvent(new ExampleEventVariables($variables));
}