MenuLinkTestWithUnsafeTitle.php

Same filename and directory in other branches
  1. 9 core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/MenuLinkTestWithUnsafeTitle.php
  2. 8.9.x core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/MenuLinkTestWithUnsafeTitle.php
  3. 10 core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/MenuLinkTestWithUnsafeTitle.php

Namespace

Drupal\menu_test\Plugin\Derivative

File

core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/MenuLinkTestWithUnsafeTitle.php

View source
<?php

namespace Drupal\menu_test\Plugin\Derivative;

use Drupal\Component\Plugin\Derivative\DeriverBase;

/**
 * Test derivative with an unsafe string.
 */
class MenuLinkTestWithUnsafeTitle extends DeriverBase {
    
    /**
     * {@inheritdoc}
     */
    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;
    }

}

Classes

Title Deprecated Summary
MenuLinkTestWithUnsafeTitle Test derivative with an unsafe string.

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