function LocalActionTest::getDerivativeDefinitions

Same name in other branches
  1. 9 core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalActionTest.php \Drupal\menu_test\Plugin\Derivative\LocalActionTest::getDerivativeDefinitions()
  2. 8.9.x core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalActionTest.php \Drupal\menu_test\Plugin\Derivative\LocalActionTest::getDerivativeDefinitions()
  3. 10 core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalActionTest.php \Drupal\menu_test\Plugin\Derivative\LocalActionTest::getDerivativeDefinitions()

Overrides DeriverBase::getDerivativeDefinitions

File

core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalActionTest.php, line 19

Class

LocalActionTest
Test derivative to check local action title escaping.

Namespace

Drupal\menu_test\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
    $this->derivatives['example'] = $base_plugin_definition + [
        'title' => "<script>alert('Welcome to the derived jungle!')</script>",
    ];
    return $this->derivatives;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.