You are here

public static function ViewsAddButtonTaxonomy::generateUrl in Views Add Button 8

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

Generate the add button URL.

Parameters

string $entity_type: Entity type ID.

string $bundle: Bundle ID.

array $options: Array of options to be passed to the Url object.

string $context: Module-specific context string.

Return value

\Drupal\Core\Url Url object which is used to construct the add button link

File

src/Plugin/views_add_button/ViewsAddButtonTaxonomy.php, line 65

Class

ViewsAddButtonTaxonomy
Taxonomy Term plugin for Views Add Button.

Namespace

Drupal\views_add_button\Plugin\views_add_button

Code

public static function generateUrl($entity_type, $bundle, array $options, $context = '') {

  // Create URL from the data above.
  $url = Url::fromRoute('entity.taxonomy_term.add_form', [
    'taxonomy_vocabulary' => $bundle,
  ], $options);
  return $url;
}