You are here

public static function TestPrepareLayout::getSubscribedEvents in Drupal 9

Same name and namespace in other branches
  1. 10 core/modules/layout_builder/tests/modules/layout_builder_element_test/src/EventSubscriber/TestPrepareLayout.php \Drupal\layout_builder_element_test\EventSubscriber\TestPrepareLayout::getSubscribedEvents()

File

core/modules/layout_builder/tests/modules/layout_builder_element_test/src/EventSubscriber/TestPrepareLayout.php, line 55

Class

TestPrepareLayout
An event subscriber to test altering section storage via the \Drupal\layout_builder\Event\PrepareLayoutEvent.

Namespace

Drupal\layout_builder_element_test\EventSubscriber

Code

public static function getSubscribedEvents() {

  // Act before core's layout builder subscriber.
  $events[LayoutBuilderEvents::PREPARE_LAYOUT][] = [
    'onBeforePrepareLayout',
    20,
  ];

  // Act after core's layout builder subscriber.
  $events[LayoutBuilderEvents::PREPARE_LAYOUT][] = [
    'onAfterPrepareLayout',
    -10,
  ];
  return $events;
}