class PrintableFormatConfigureTabs in Printer and PDF versions for Drupal 8+ 2.x
Same name and namespace in other branches
- 8 src/Plugin/Derivative/PrintableFormatConfigureTabs.php \Drupal\printable\Plugin\Derivative\PrintableFormatConfigureTabs
Local tasks plugin derivative to provide a tab for each printable format.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\printable\Plugin\Derivative\PrintableFormatConfigureTabs implements ContainerDeriverInterface
Expanded class hierarchy of PrintableFormatConfigureTabs
1 file declares its use of PrintableFormatConfigureTabs
- PrintableFormatConfigureTabsTest.php in tests/
src/ Unit/ Plugin/ Derivative/ PrintableFormatConfigureTabsTest.php
1 string reference to 'PrintableFormatConfigureTabs'
File
- src/
Plugin/ Derivative/ PrintableFormatConfigureTabs.php, line 13
Namespace
Drupal\printable\Plugin\DerivativeView source
class PrintableFormatConfigureTabs extends DeriverBase implements ContainerDeriverInterface {
/**
* The printable format plugin manager.
*
* @var \Drupal\printable\PrintableFormatPluginManager
*/
protected $printableFormatManager;
/**
* Construct a new printable format configuration tab plugin derivative.
*
* @param \Drupal\printable\PrintableFormatPluginManager $printable_format_manager
* The printable format plugin manager.
*/
public function __construct(PrintableFormatPluginManager $printable_format_manager) {
$this->printableFormatManager = $printable_format_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($container
->get('printable.format_plugin_manager'));
}
/**
* {@inheritdoc}
*/
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
PrintableFormatConfigureTabs:: |
protected | property | The printable format plugin manager. | |
PrintableFormatConfigureTabs:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
PrintableFormatConfigureTabs:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
PrintableFormatConfigureTabs:: |
public | function | Construct a new printable format configuration tab plugin derivative. |