You are here

public function PrintableFormatConfigureTabs::getDerivativeDefinitions in Printer and PDF versions for Drupal 8+ 8

Same name and namespace in other branches
  1. 2.x src/Plugin/Derivative/PrintableFormatConfigureTabs.php \Drupal\printable\Plugin\Derivative\PrintableFormatConfigureTabs::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/PrintableFormatConfigureTabs.php, line 44

Class

PrintableFormatConfigureTabs
Local tasks plugin derivative to provide a tab for each printable format.

Namespace

Drupal\printable\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  foreach ($this->printableFormatManager
    ->getDefinitions() as $key => $definition) {
    $this->derivatives[$key] = $base_plugin_definition;
    $this->derivatives[$key]['title'] = $definition['title'];
    $this->derivatives[$key]['route_name'] = 'printable.format_configure_' . $key;
  }
  return $this->derivatives;
}