You are here

class ViewsMegarowResponseRenderer in Views Megarow 8

Converts a controller result into an Views Megarow response object.

Hierarchy

Expanded class hierarchy of ViewsMegarowResponseRenderer

1 file declares its use of ViewsMegarowResponseRenderer
ViewsMegarowController.php in src/Controller/ViewsMegarowController.php
1 string reference to 'ViewsMegarowResponseRenderer'
views_megarow.services.yml in ./views_megarow.services.yml
views_megarow.services.yml
1 service uses ViewsMegarowResponseRenderer
views_megarow_renderer.megarow in ./views_megarow.services.yml
Drupal\views_megarow\Core\ViewsMegarowResponseRenderer

File

src/Core/ViewsMegarowResponseRenderer.php, line 13

Namespace

Drupal\views_megarow\Core
View source
class ViewsMegarowResponseRenderer extends HtmlRenderer {

  /**
   * {@inheritdoc}
   *
   * The entire HTML: takes a #type 'page' and wraps it in a #type 'html'.
   */
  public function renderResponse(array $main_content, Request $request, RouteMatchInterface $route_match) {
    $content = $this->renderer
      ->render($main_content);

    // Set the generator in the HTTP header.
    list($version) = explode('.', \Drupal::VERSION, 2);
    return new Response($content, 200, [
      'X-Generator' => 'Drupal ' . $version . ' (http://drupal.org)',
    ]);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
HtmlRenderer::$displayVariantManager protected property The display variant manager.
HtmlRenderer::$eventDispatcher protected property The event dispatcher.
HtmlRenderer::$moduleHandler protected property The module handler.
HtmlRenderer::$renderCache protected property The render cache service.
HtmlRenderer::$renderer protected property The renderer service.
HtmlRenderer::$rendererConfig protected property The renderer configuration array.
HtmlRenderer::$titleResolver protected property The title resolver.
HtmlRenderer::buildPageTopAndBottom public function Invokes the page top and bottom hooks.
HtmlRenderer::invokePageAttachmentHooks public function Invokes the page attachment hooks.
HtmlRenderer::prepare protected function Prepares the HTML body: wraps the main content in #type 'page'.
HtmlRenderer::__construct public function Constructs a new HtmlRenderer.
ViewsMegarowResponseRenderer::renderResponse public function The entire HTML: takes a #type 'page' and wraps it in a #type 'html'. Overrides HtmlRenderer::renderResponse