You are here

public function TagcloudsTermsBlock::getDerivativeDefinitions in TagCloud 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Derivative/TagcloudsTermsBlock.php \Drupal\tagclouds\Plugin\Derivative\TagcloudsTermsBlock::getDerivativeDefinitions()
  2. 1.0.x src/Plugin/Derivative/TagcloudsTermsBlock.php \Drupal\tagclouds\Plugin\Derivative\TagcloudsTermsBlock::getDerivativeDefinitions()

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

src/Plugin/Derivative/TagcloudsTermsBlock.php, line 23

Class

TagcloudsTermsBlock
Provides dynamic definitions for tagclouds blocks based on Voacabularies.

Namespace

Drupal\tagclouds\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  foreach (Vocabulary::loadMultiple() as $voc) {
    $this->derivatives[$voc
      ->id()] = $base_plugin_definition;
    $this->derivatives[$voc
      ->id()]['admin_label'] = $this
      ->t('Tags in @voc', [
      '@voc' => $voc
        ->label(),
    ]);
  }
  return parent::getDerivativeDefinitions($base_plugin_definition);
}