You are here

public static function ViewsAddButtonDefault::generateLink in Views Add Button 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/views_add_button/ViewsAddButtonDefault.php \Drupal\views_add_button\Plugin\views_add_button\ViewsAddButtonDefault::generateLink()

Generate the add button link.

Parameters

$text: The link text.

Url $url: The Url for constructing the link.

array $options: Array of options from the VAB settings.

Return value

\Drupal\Core\Link Link object which is used to construct the add button.

2 calls to ViewsAddButtonDefault::generateLink()
ViewsAddButtonArea::render in src/Plugin/views/area/ViewsAddButtonArea.php
Render the area.
ViewsAddButtonField::render in src/Plugin/views/field/ViewsAddButtonField.php
Renders the field.

File

src/Plugin/views_add_button/ViewsAddButtonDefault.php, line 77

Class

ViewsAddButtonDefault
Default plugin for Views Add Button.

Namespace

Drupal\views_add_button\Plugin\views_add_button

Code

public static function generateLink($text, Url $url, array $options = []) {
  return Link::fromTextAndUrl($text, $url);
}