public function ExplorerPageDisplayVariantSubscriber::onSelectPageDisplayVariant in GraphQL 8
Same name and namespace in other branches
- 8.2 src/EventSubscriber/ExplorerPageDisplayVariantSubscriber.php \Drupal\graphql\EventSubscriber\ExplorerPageDisplayVariantSubscriber::onSelectPageDisplayVariant()
- 8.3 src/EventSubscriber/ExplorerPageDisplayVariantSubscriber.php \Drupal\graphql\EventSubscriber\ExplorerPageDisplayVariantSubscriber::onSelectPageDisplayVariant()
Disables any display variant on the explorer page.
Parameters
\Drupal\Core\Render\PageDisplayVariantSelectionEvent $event: The event to process.
File
- src/
EventSubscriber/ ExplorerPageDisplayVariantSubscriber.php, line 19
Class
- ExplorerPageDisplayVariantSubscriber
- Disables any display variant on the explorer page.
Namespace
Drupal\graphql\EventSubscriberCode
public function onSelectPageDisplayVariant(PageDisplayVariantSelectionEvent $event) {
if ($event
->getRouteMatch()
->getRouteName() === 'graphql.explorer') {
$event
->setPluginId(NULL)
->stopPropagation();
}
}