public function ExampleViewsEventSubscribers::preBuild in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 examples/ExampleViewsEventSubscribers.php \Drupal\hook_event_dispatcher\ExampleViewsEventSubscribers::preBuild()
Pre build event handler.
Parameters
\Drupal\views_event_dispatcher\Event\Views\ViewsPreBuildEvent $event: The event.
File
- examples/
ExampleViewsEventSubscribers.php, line 49
Class
- ExampleViewsEventSubscribers
- Class ExampleViewsEventSubscribers.
Namespace
Drupal\hook_event_dispatcherCode
public function preBuild(ViewsPreBuildEvent $event) : void {
$view = $event
->getView();
// Do something with the view.
$view
->setArguments([
'test',
]);
}