class PluginExample

Same name in this branch
  1. 10 core/modules/system/tests/modules/plugin_test/src/Plugin/Annotation/PluginExample.php \Drupal\plugin_test\Plugin\Annotation\PluginExample
Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/plugin_test/src/Plugin/Annotation/PluginExample.php \Drupal\plugin_test\Plugin\Annotation\PluginExample
  2. 8.9.x core/modules/system/tests/modules/plugin_test/src/Plugin/Annotation/PluginExample.php \Drupal\plugin_test\Plugin\Annotation\PluginExample
  3. 11.x core/modules/system/tests/modules/plugin_test/src/Plugin/Attribute/PluginExample.php \Drupal\plugin_test\Plugin\Attribute\PluginExample
  4. 11.x core/modules/system/tests/modules/plugin_test/src/Plugin/Annotation/PluginExample.php \Drupal\plugin_test\Plugin\Annotation\PluginExample

Defines a custom PluginExample attribute.

Attributes

#[\Attribute(\Attribute::TARGET_CLASS)]

Hierarchy

  • class \Drupal\plugin_test\Plugin\Attribute\PluginExample implements \Drupal\Component\Plugin\Attribute\Plugin

Expanded class hierarchy of PluginExample

2 files declare their use of PluginExample
DefaultPluginManagerTest.php in core/tests/Drupal/KernelTests/Core/Plugin/DefaultPluginManagerTest.php
Example3.php in core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/custom_annotation/Example3.php

File

core/modules/system/tests/modules/plugin_test/src/Plugin/Attribute/PluginExample.php, line 10

Namespace

Drupal\plugin_test\Plugin\Attribute
View source
class PluginExample extends Plugin {
  
  /**
   * Constructs a PluginExample attribute.
   *
   * @param string $id
   *   The plugin ID.
   * @param string $custom
   *   Some other sample plugin metadata.
   */
  public function __construct(public readonly string $id, public readonly ?string $custom = NULL) {
  }

}

Members

Title Sort descending Modifiers Object type Summary
PluginExample::__construct public function Constructs a PluginExample attribute.

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