Same filename in this branch
- 10 core/lib/Drupal/Core/Render/BareHtmlPageRenderer.php
- 10 core/lib/Drupal/Core/ProxyClass/Render/BareHtmlPageRenderer.php
Same filename and directory in other branches
- 8.9.x core/lib/Drupal/Core/Render/BareHtmlPageRenderer.php
- 9 core/lib/Drupal/Core/Render/BareHtmlPageRenderer.php
Namespace
Drupal\Core\Render
File
core/lib/Drupal/Core/Render/BareHtmlPageRenderer.php
View source
<?php
namespace Drupal\Core\Render;
class BareHtmlPageRenderer implements BareHtmlPageRendererInterface {
protected $renderer;
protected $htmlResponseAttachmentsProcessor;
public function __construct(RendererInterface $renderer, AttachmentsResponseProcessorInterface $html_response_attachments_processor) {
$this->renderer = $renderer;
$this->htmlResponseAttachmentsProcessor = $html_response_attachments_processor;
}
public function renderBarePage(array $content, $title, $page_theme_property, array $page_additions = []) {
$attributes = [
'class' => [
str_replace('_', '-', $page_theme_property),
],
];
$html = [
'#type' => 'html',
'#attributes' => $attributes,
'page' => [
'#type' => 'page',
'#theme' => $page_theme_property,
'#title' => $title,
'content' => $content,
] + $page_additions,
];
if (!isset($page_additions['#show_messages']) || $page_additions['#show_messages'] === TRUE) {
$html['page']['highlighted'] = [
'#type' => 'status_messages',
];
}
system_page_attachments($html['page']);
$this->renderer
->renderRoot($html);
$response = new HtmlResponse();
$response
->setContent($html);
$response = $this->htmlResponseAttachmentsProcessor
->processAttachments($response);
return $response;
}
}
Classes