You are here

public function ForwardLinkGeneratorInterface::generate in Forward 4.x

Same name and namespace in other branches
  1. 4.0.x src/Services/ForwardLinkGeneratorInterface.php \Drupal\forward\Services\ForwardLinkGeneratorInterface::generate()

Generate a Forward link for a given entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: Entity for which the link is being generated.

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 value

array A render array containing the generated link.

See also

the ForwardLinkFormatter for example usage.

1 method overrides ForwardLinkGeneratorInterface::generate()
ForwardLinkGenerator::generate in src/Services/ForwardLinkGenerator.php
Generate a Forward link for a given entity.

File

src/Services/ForwardLinkGeneratorInterface.php, line 29

Class

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

Namespace

Drupal\forward\Services

Code

public function generate(EntityInterface $entity, array $settings);