You are here

interface TocBuilderInterface in TOC API 8

Provides an interface defining a TOC builder.

Hierarchy

Expanded class hierarchy of TocBuilderInterface

All classes that implement TocBuilderInterface

File

src/TocBuilderInterface.php, line 8

Namespace

Drupal\toc_api
View source
interface TocBuilderInterface {

  /**
   * Renders a table of contents' body.
   *
   * @param \Drupal\toc_api\TocInterface $toc
   *   A TOC object.
   *
   * @return string
   *   The table of content's body content with bookmarked, typed, and custom
   *   headers with back to top links.
   */
  public function renderContent(TocInterface $toc);

  /**
   * Build a table of contents' body.
   *
   * @param \Drupal\toc_api\TocInterface $toc
   *   A TOC object.
   *
   * @return array
   *   A render array containing the table of content's body content with bookmarked, typed, and custom
   *   headers with back to top links.
   */
  public function buildContent(TocInterface $toc);

  /**
   * Renders a table of contents navigation.
   *
   * @param \Drupal\toc_api\TocInterface $toc
   *   A TOC object.
   *
   * @return \Drupal\Component\Render\MarkupInterface
   *   The rendered table of contents.
   */
  public function renderToc(TocInterface $toc);

  /**
   * Builds a table of contents navigation.
   *
   * @param \Drupal\toc_api\TocInterface $toc
   *   A TOC object.
   *
   * @return array
   *   A render array containing a table of contents.
   */
  public function buildToc(TocInterface $toc);

}

Members

Namesort descending Modifiers Type Description Overrides
TocBuilderInterface::buildContent public function Build a table of contents' body. 1
TocBuilderInterface::buildToc public function Builds a table of contents navigation. 1
TocBuilderInterface::renderContent public function Renders a table of contents' body. 1
TocBuilderInterface::renderToc public function Renders a table of contents navigation. 1