You are here

protected function PrintableFormatBase::buildContent in Printer and PDF versions for Drupal 8+ 8

Same name and namespace in other branches
  1. 2.x src/Plugin/PrintableFormatBase.php \Drupal\printable\Plugin\PrintableFormatBase::buildContent()

Build a render array of the content, wrapped in the printable theme.

Return value

array A render array representing the themed output of the content.

2 calls to PrintableFormatBase::buildContent()
PdfFormat::buildPdfContent in modules/printable_pdf/src/Plugin/PrintableFormat/PdfFormat.php
Get the HTML content for PDF generation.
PrintableFormatBase::getOutput in src/Plugin/PrintableFormatBase.php
Get the HTML output of the whole page and pass to the response object.

File

src/Plugin/PrintableFormatBase.php, line 160

Class

PrintableFormatBase
Provides a base class for Filter plugins.

Namespace

Drupal\printable\Plugin

Code

protected function buildContent() {
  $build = [
    '#theme' => [
      'printable__' . $this
        ->getPluginId(),
      'printable',
    ],
    '#header' => [
      '#theme' => [
        'printable_header__' . $this
          ->getPluginId(),
        'printable_header',
      ],
      '#logo_url' => theme_get_setting('logo.url'),
    ],
    '#content' => $this->content,
    '#footer' => [
      '#theme' => [
        'printable_footer__' . $this
          ->getPluginId(),
        'printable_footer',
      ],
      '#footer_content' => $this->footerContent,
    ],
  ];
  if ($include_path = $this->printableCssInclude
    ->getCssIncludePath()) {
    $build['#attached']['css'][] = $include_path;
  }
  return $build;
}