class ViewsMegarowResponseRenderer in Views Megarow 8
Converts a controller result into an Views Megarow response object.
Hierarchy
- class \Drupal\Core\Render\MainContent\HtmlRenderer implements MainContentRendererInterface
- class \Drupal\views_megarow\Core\ViewsMegarowResponseRenderer
Expanded class hierarchy of ViewsMegarowResponseRenderer
1 file declares its use of ViewsMegarowResponseRenderer
- ViewsMegarowController.php in src/
Controller/ ViewsMegarowController.php
1 string reference to 'ViewsMegarowResponseRenderer'
1 service uses ViewsMegarowResponseRenderer
File
- src/
Core/ ViewsMegarowResponseRenderer.php, line 13
Namespace
Drupal\views_megarow\CoreView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HtmlRenderer:: |
protected | property | The display variant manager. | |
HtmlRenderer:: |
protected | property | The event dispatcher. | |
HtmlRenderer:: |
protected | property | The module handler. | |
HtmlRenderer:: |
protected | property | The render cache service. | |
HtmlRenderer:: |
protected | property | The renderer service. | |
HtmlRenderer:: |
protected | property | The renderer configuration array. | |
HtmlRenderer:: |
protected | property | The title resolver. | |
HtmlRenderer:: |
public | function | Invokes the page top and bottom hooks. | |
HtmlRenderer:: |
public | function | Invokes the page attachment hooks. | |
HtmlRenderer:: |
protected | function | Prepares the HTML body: wraps the main content in #type 'page'. | |
HtmlRenderer:: |
public | function | Constructs a new HtmlRenderer. | |
ViewsMegarowResponseRenderer:: |
public | function |
The entire HTML: takes a #type 'page' and wraps it in a #type 'html'. Overrides HtmlRenderer:: |