BookExport
class BookExport (View source)
Provides methods for exporting book to different formats.
If you would like to add another format, swap this class in container.
Properties
| protected EntityStorageInterface | $nodeStorage | The node storage. |
|
| protected EntityViewBuilderInterface | $viewBuilder | The node view builder. |
|
| protected BookManagerInterface | $bookManager | The book manager. |
|
| protected EntityRepositoryInterface | $entityRepository | The entity repository service. |
Methods
Constructs a BookExport object.
Traverses the book tree to build printable or exportable output.
Generates printer-friendly HTML for a node.
Details
__construct(EntityTypeManagerInterface $entity_type_manager, BookManagerInterface $book_manager, EntityRepositoryInterface $entity_repository = NULL)
Constructs a BookExport object.
array
bookExportHtml(NodeInterface $node)
Generates HTML for export when invoked by book_export().
The given node is embedded to its absolute depth in a top level section. For example, a child node with depth 2 in the hierarchy is contained in (otherwise empty)
protected array
exportTraverse(array $tree, callable $callable)
Traverses the book tree to build printable or exportable output.
During the traversal, the callback is applied to each node and is called recursively for each child of the node (in weight, title order).
protected array
bookNodeExport(NodeInterface $node, string $children = '')
Generates printer-friendly HTML for a node.