class LocalTaskTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTest.php \Drupal\menu_test\Plugin\Derivative\LocalTaskTest
- 9 core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTest.php \Drupal\menu_test\Plugin\Derivative\LocalTaskTest
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\menu_test\Plugin\Derivative\LocalTaskTest
Expanded class hierarchy of LocalTaskTest
1 string reference to 'LocalTaskTest'
- menu_test.links.task.yml in core/
modules/ system/ tests/ modules/ menu_test/ menu_test.links.task.yml - core/modules/system/tests/modules/menu_test/menu_test.links.task.yml
File
- core/
modules/ system/ tests/ modules/ menu_test/ src/ Plugin/ Derivative/ LocalTaskTest.php, line 7
Namespace
Drupal\menu_test\Plugin\DerivativeView source
class LocalTaskTest extends DeriverBase {
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$weight = $base_plugin_definition['weight'];
foreach ([
'derive1' => 'Derive 1',
'derive2' => 'Derive 2',
] as $key => $title) {
$this->derivatives[$key] = $base_plugin_definition;
$this->derivatives[$key]['title'] = $title;
$this->derivatives[$key]['route_parameters'] = [
'placeholder' => $key,
];
// Ensure weights for testing.
$this->derivatives[$key]['weight'] = $weight++;
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
LocalTaskTest:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |