class BlockPageDisplayVariantSubscriber
Same name in other branches
- 8.9.x core/modules/block/src/EventSubscriber/BlockPageDisplayVariantSubscriber.php \Drupal\block\EventSubscriber\BlockPageDisplayVariantSubscriber
- 10 core/modules/block/src/EventSubscriber/BlockPageDisplayVariantSubscriber.php \Drupal\block\EventSubscriber\BlockPageDisplayVariantSubscriber
- 11.x core/modules/block/src/EventSubscriber/BlockPageDisplayVariantSubscriber.php \Drupal\block\EventSubscriber\BlockPageDisplayVariantSubscriber
Selects the block page display variant.
Hierarchy
- class \Drupal\block\EventSubscriber\BlockPageDisplayVariantSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of BlockPageDisplayVariantSubscriber
See also
\Drupal\block\Plugin\DisplayVariant\BlockPageVariant
1 string reference to 'BlockPageDisplayVariantSubscriber'
- block.services.yml in core/
modules/ block/ block.services.yml - core/modules/block/block.services.yml
1 service uses BlockPageDisplayVariantSubscriber
File
-
core/
modules/ block/ src/ EventSubscriber/ BlockPageDisplayVariantSubscriber.php, line 14
Namespace
Drupal\block\EventSubscriberView source
class BlockPageDisplayVariantSubscriber implements EventSubscriberInterface {
/**
* Selects the block page display variant.
*
* @param \Drupal\Core\Render\PageDisplayVariantSelectionEvent $event
* The event to process.
*/
public function onSelectPageDisplayVariant(PageDisplayVariantSelectionEvent $event) {
$event->setPluginId('block_page');
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[RenderEvents::SELECT_PAGE_DISPLAY_VARIANT][] = [
'onSelectPageDisplayVariant',
];
return $events;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
BlockPageDisplayVariantSubscriber::getSubscribedEvents | public static | function | |
BlockPageDisplayVariantSubscriber::onSelectPageDisplayVariant | public | function | Selects the block page display variant. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.