PluginExample.php

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

Namespace

Drupal\plugin_test\Plugin\Attribute

File

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

View source
<?php

declare (strict_types=1);
namespace Drupal\plugin_test\Plugin\Attribute;

use Drupal\Component\Plugin\Attribute\Plugin;

/**
 * Defines a custom PluginExample attribute.
 */
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) {
  }

}

Classes

Title Deprecated Summary
PluginExample Defines a custom PluginExample attribute.

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