You are here

public function MenuLinkTestWithUnsafeTitle::getDerivativeDefinitions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/MenuLinkTestWithUnsafeTitle.php \Drupal\menu_test\Plugin\Derivative\MenuLinkTestWithUnsafeTitle::getDerivativeDefinitions()

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/MenuLinkTestWithUnsafeTitle.php, line 20
Contains \Drupal\menu_test\Plugin\Derivative\MenuLinkTestWithUnsafeTitle.

Class

MenuLinkTestWithUnsafeTitle
Test derivative with an unsafe string.

Namespace

Drupal\menu_test\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  $this->derivatives['unsafe'] = [
    'title' => '<script>alert("Even more wild animals")</script>',
    'menu_name' => 'tools',
  ] + $base_plugin_definition;
  return $this->derivatives;
}