You are here

public function RemovePageThemeWrapperSubscriberD9::onViewRenderArray in Acquia Content Hub 8

Modifies render array for D9.

Parameters

\Symfony\Component\HttpKernel\Event\ViewEvent $event: Controller result event.

Overrides MainContentViewSubscriber::onViewRenderArray

File

src/EventSubscriber/View/RemovePageThemeWrapperSubscriberD9.php, line 34

Class

RemovePageThemeWrapperSubscriberD9
Subscriber to Remove Page Theme Wrapper.

Namespace

Drupal\acquia_contenthub\EventSubscriber\View

Code

public function onViewRenderArray(ViewEvent $event) {
  $request = $event
    ->getRequest();
  if ($request->attributes
    ->all()['_route'] === 'acquia_contenthub.content_entity_display.entity') {
    parent::onViewRenderArray($event);
    $event
      ->getResponse()
      ->setContent(self::removeSurroundingMarkup('dialog-off-canvas-main-canvas', $event
      ->getResponse()
      ->getContent()));
  }
}