class Fz152LocalTasks in FZ152 8
Defines dynamic local tasks.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\fz152\Plugin\Derivative\Fz152LocalTasks
Expanded class hierarchy of Fz152LocalTasks
1 string reference to 'Fz152LocalTasks'
File
- src/
Plugin/ Derivative/ Fz152LocalTasks.php, line 10
Namespace
Drupal\fz152\Plugin\DerivativeView source
class Fz152LocalTasks extends DeriverBase {
/**
* Implement dynamic logic to provide values for the same keys as in
* fz152.links.task.yml.
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$plugin_service = \Drupal::service('plugin.manager.fz152');
foreach ($plugin_service
->getDefinitions() as $plugin_id => $plugin) {
$instance = $plugin_service
->createInstance($plugin_id);
$route_info = $instance
->getSettingsPage();
$this->derivatives['fz152.admin.' . $plugin_id] = $base_plugin_definition;
$this->derivatives['fz152.admin.' . $plugin_id]['title'] = $route_info['title'];
$this->derivatives['fz152.admin.' . $plugin_id]['route_name'] = 'fz152.settings.' . $plugin_id;
$this->derivatives['fz152.admin.' . $plugin_id]['base_route'] = 'fz152.settings';
$this->derivatives['fz152.admin.' . $plugin_id]['weight'] = $route_info['weight'];
}
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:: |
|
Fz152LocalTasks:: |
public | function |
Implement dynamic logic to provide values for the same keys as in
fz152.links.task.yml. Overrides DeriverBase:: |