protected function BlockPluginUI::facetLink

Creates a facet link for a given facet of a display plugin.

Provides individually formatted links for the faceting that happens within the user interface. Since this is a faceting style procedure, each plugin may be parsed multiple times in order to extract all facets and their appropriate labels.

The $display_plugin_id and $display_plugin_definition are provided for convenience when overriding this method.

Parameters

string $facet: A simple string indicating what element of the $display_plugin_definition to utilize for faceting.

string $display_plugin_id: The plugin ID of the plugin we are currently parsing a facet link from.

array $display_plugin_definition: The plugin definition we are parsing.

Return value

array Returns a row array comaptible with theme_links().

1 call to BlockPluginUI::facetLink()
BlockPluginUI::form in drupal/core/modules/block/lib/Drupal/block/Plugin/PluginUI/BlockPluginUI.php
Overrides \Drupal\system\Plugin\PluginUIBase::form().

File

drupal/core/modules/block/lib/Drupal/block/Plugin/PluginUI/BlockPluginUI.php, line 182

Class

BlockPluginUI
Defines an overrideable UI for block selection, configuration, and placement.

Namespace

Drupal\block\Plugin\PluginUI

Code

protected function facetLink($facet, $display_plugin_id, array $display_plugin_definition) {
  $plugin_definition = $this
    ->getPluginDefinition();
  return array(
    'title' => $display_plugin_definition[$facet],
    'href' => $plugin_definition['path'] . '/' . $this
      ->getPluginId() . '/' . $facet . ':' . $display_plugin_definition[$facet],
  );
}