You are here

interface ForwardLinkGeneratorInterface in Forward 4.0.x

Same name and namespace in other branches
  1. 4.x src/Services/ForwardLinkGeneratorInterface.php \Drupal\forward\Services\ForwardLinkGeneratorInterface

Defines an interface for generating a Forward link on an entity.

Hierarchy

Expanded class hierarchy of ForwardLinkGeneratorInterface

All classes that implement ForwardLinkGeneratorInterface

1 file declares its use of ForwardLinkGeneratorInterface
ForwardLinkFormatter.php in src/Plugin/Field/FieldFormatter/ForwardLinkFormatter.php

File

src/Services/ForwardLinkGeneratorInterface.php, line 10

Namespace

Drupal\forward\Services
View source
interface ForwardLinkGeneratorInterface {

  /**
   * Generate a Forward link for a given entity.
   *
   * See ForwardLinkFormatter.php for example usage.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   Entity for which the link is being generated.
   * @param array $settings
   *   Array with these keys:
   *     title - the link title, with tokens allowed
   *     style - 0, 1, or 2 (text only, icon only, text and icon)
   *     icon - optional path to custom icon, or a blank string
   *     nofollow - true if a nofollow tag should be included.
   *
   * @return array
   *   A render array containing the generated link.
   */
  public function generate(EntityInterface $entity, array $settings);

}

Members

Namesort descending Modifiers Type Description Overrides
ForwardLinkGeneratorInterface::generate public function Generate a Forward link for a given entity. 1