You are here

interface LinkExtractorInterface in Printer and PDF versions for Drupal 8+ 8

Same name and namespace in other branches
  1. 2.x src/LinkExtractor/LinkExtractorInterface.php \Drupal\printable\LinkExtractor\LinkExtractorInterface

Defines an interface for extracting links from a string of HTMl.

Hierarchy

Expanded class hierarchy of LinkExtractorInterface

All classes that implement LinkExtractorInterface

2 files declare their use of LinkExtractorInterface
PdfFormat.php in modules/printable_pdf/src/Plugin/PrintableFormat/PdfFormat.php
PrintableFormatBase.php in src/Plugin/PrintableFormatBase.php

File

src/LinkExtractor/LinkExtractorInterface.php, line 8

Namespace

Drupal\printable\LinkExtractor
View source
interface LinkExtractorInterface {

  /**
   * Highlight hrefs from links in the given HTML string.
   *
   * @param string $string
   *   The HTML string to extract links from.
   *
   * @return string
   *   The HTML string, with links highlighted.
   */
  public function extract($string);

  /**
   * Remove href from links in the given HTML string.
   *
   * @param string $content
   *   The HTML string to remove links from.
   * @param string $attr
   *   The attribute which has to be removed from the link.
   *
   * @return string
   *   The HTML string, with links removed.
   */
  public function removeAttribute($content, $attr);

  /**
   * List the links at the bottom of page.
   *
   * @param string $content
   *   The HTML string which has links present.
   *
   * @return string
   *   The HTML string, containing links.
   */
  public function listAttribute($content);

}

Members

Namesort descending Modifiers Type Description Overrides
LinkExtractorInterface::extract public function Highlight hrefs from links in the given HTML string. 1
LinkExtractorInterface::listAttribute public function List the links at the bottom of page. 1
LinkExtractorInterface::removeAttribute public function Remove href from links in the given HTML string. 1