Chris@0: renderer = $renderer; Chris@0: $this->htmlResponseAttachmentsProcessor = $html_response_attachments_processor; Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function renderBarePage(array $content, $title, $page_theme_property, array $page_additions = []) { Chris@0: $attributes = [ Chris@0: 'class' => [ Chris@0: str_replace('_', '-', $page_theme_property), Chris@0: ], Chris@0: ]; Chris@0: $html = [ Chris@0: '#type' => 'html', Chris@0: '#attributes' => $attributes, Chris@0: 'page' => [ Chris@0: '#type' => 'page', Chris@0: '#theme' => $page_theme_property, Chris@0: '#title' => $title, Chris@0: 'content' => $content, Chris@0: ] + $page_additions, Chris@0: ]; Chris@0: Chris@0: // For backwards compatibility. Chris@0: // @todo In Drupal 9, add a $show_messages function parameter. Chris@0: if (!isset($page_additions['#show_messages']) || $page_additions['#show_messages'] === TRUE) { Chris@0: $html['page']['highlighted'] = ['#type' => 'status_messages']; Chris@0: } Chris@0: Chris@0: // Add the bare minimum of attachments from the system module and the Chris@0: // current maintenance theme. Chris@0: system_page_attachments($html['page']); Chris@0: $this->renderer->renderRoot($html); Chris@0: Chris@0: $response = new HtmlResponse(); Chris@0: $response->setContent($html); Chris@0: // Process attachments, because this does not go via the regular render Chris@0: // pipeline, but will be sent directly. Chris@0: $response = $this->htmlResponseAttachmentsProcessor->processAttachments($response); Chris@0: return $response; Chris@0: } Chris@0: Chris@0: }