You are here

public function ExampleViewsEventSubscribers::preExecute in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x examples/ExampleViewsEventSubscribers.php \Drupal\hook_event_dispatcher\ExampleViewsEventSubscribers::preExecute()

Pre execute event handler.

Parameters

\Drupal\views_event_dispatcher\Event\Views\ViewsPreExecuteEvent $event: The event.

File

examples/ExampleViewsEventSubscribers.php, line 98

Class

ExampleViewsEventSubscribers
Class ExampleViewsEventSubscribers.

Namespace

Drupal\hook_event_dispatcher

Code

public function preExecute(ViewsPreExecuteEvent $event) : void {
  $view = $event
    ->getView();

  // Do something with the view.
  $view
    ->setArguments([
    'test',
  ]);
}