BookExport::bookNodeExport

protected BookExport::bookNodeExport(NodeInterface $node, $children = '')

Generates printer-friendly HTML for a node.

Parameters

\Drupal\node\NodeInterface $node: The node that will be output.

string $children: (optional) All the rendered child nodes within the current node. Defaults to an empty string.

Return value

array A render array for the exported HTML of a given node.

See also

\Drupal\book\BookExport::exportTraverse()

File

core/modules/book/src/BookExport.php, line 132

Class

BookExport
Provides methods for exporting book to different formats.

Namespace

Drupal\book

Code

protected function bookNodeExport(NodeInterface $node, $children = '') {
  $build = $this->viewBuilder->view($node, 'print', NULL);
  unset($build['#theme']);

  return array(
    '#theme' => 'book_node_export_html',
    '#content' => $build,
    '#node' => $node,
    '#children' => $children,
  );
}
doc_Drupal
2016-10-29 08:48:05
Comments
Leave a Comment

Please login to continue.