class DynamicLocalTasks in String Overrides 8
Defines dynamic local tasks (menu tabs).
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\stringoverrides\Plugin\Derivative\DynamicLocalTasks
Expanded class hierarchy of DynamicLocalTasks
1 string reference to 'DynamicLocalTasks'
File
- src/
Plugin/ Derivative/ DynamicLocalTasks.php, line 10
Namespace
Drupal\stringoverrides\Plugin\DerivativeView source
class DynamicLocalTasks extends DeriverBase {
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$languages = \Drupal::languageManager()
->getLanguages();
foreach ($languages as $language_code => $language) {
$this->derivatives['stringoverrides.translations_form.' . $language_code] = [
'title' => $language
->getName(),
'base_route' => 'stringoverrides.translations_form',
'route_name' => 'stringoverrides.translations_form',
'route_parameters' => [
'language' => $language_code,
],
'weight' => 100,
] + $base_plugin_definition;
}
return parent::getDerivativeDefinitions($base_plugin_definition);
}
}
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:: |
|
DynamicLocalTasks:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |