class FormatLocalTask in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_entity/src/Plugin/Derivative/FormatLocalTask.php \Drupal\bibcite_entity\Plugin\Derivative\FormatLocalTask
Provides dynamic tabs based on available formats.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\bibcite_entity\Plugin\Derivative\FormatLocalTask implements ContainerDeriverInterface
Expanded class hierarchy of FormatLocalTask
1 string reference to 'FormatLocalTask'
- bibcite_entity.links.task.yml in modules/
bibcite_entity/ bibcite_entity.links.task.yml - modules/bibcite_entity/bibcite_entity.links.task.yml
File
- modules/
bibcite_entity/ src/ Plugin/ Derivative/ FormatLocalTask.php, line 13
Namespace
Drupal\bibcite_entity\Plugin\DerivativeView source
class FormatLocalTask extends DeriverBase implements ContainerDeriverInterface {
/**
* Bibcite format manager service.
*
* @var \Drupal\bibcite\Plugin\BibciteFormatManagerInterface
*/
protected $formatManager;
/**
* Construct a new FormatLocalTask.
*
* @param \Drupal\bibcite\Plugin\BibciteFormatManagerInterface $format_manager
* Bibcite format manager service.
*/
public function __construct(BibciteFormatManagerInterface $format_manager) {
$this->formatManager = $format_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($container
->get('plugin.manager.bibcite_format'));
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
foreach ($this->formatManager
->getDefinitions() as $format_id => $format_definition) {
$this->derivatives[$format_id] = $base_plugin_definition;
$this->derivatives[$format_id]['title'] = $format_definition['label'];
$this->derivatives[$format_id]['route_parameters']['bibcite_format'] = $format_id;
}
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:: |
|
FormatLocalTask:: |
protected | property | Bibcite format manager service. | |
FormatLocalTask:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
FormatLocalTask:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
FormatLocalTask:: |
public | function | Construct a new FormatLocalTask. |