Plugin.php

Same filename in this branch
  1. 10 composer/Plugin/Scaffold/Plugin.php
  2. 10 core/lib/Drupal/Component/Annotation/Plugin.php
Same filename and directory in other branches
  1. 9 composer/Plugin/Scaffold/Plugin.php
  2. 9 core/lib/Drupal/Component/Annotation/Plugin.php
  3. 8.9.x composer/Plugin/Scaffold/Plugin.php
  4. 8.9.x core/lib/Drupal/Component/Annotation/Plugin.php
  5. 11.x composer/Plugin/Scaffold/Plugin.php
  6. 11.x core/lib/Drupal/Component/Annotation/Plugin.php
  7. 11.x core/lib/Drupal/Component/Plugin/Attribute/Plugin.php
  8. 11.x composer/Plugin/RecipeUnpack/Plugin.php

Namespace

Drupal\Component\Plugin\Attribute

File

core/lib/Drupal/Component/Plugin/Attribute/Plugin.php

View source
<?php

namespace Drupal\Component\Plugin\Attribute;


/**
 * Defines a Plugin attribute object.
 *
 * Attributes in plugin classes can use this class in order to pass various
 * metadata about the plugin through the parser to
 * DiscoveryInterface::getDefinitions() calls.
 *
 * @ingroup plugin_api
 */
class Plugin extends AttributeBase {
  
  /**
   * Constructs a plugin attribute object.
   *
   * @param string $id
   *   The attribute class ID.
   * @param class-string|null $deriver
   *   (optional) The deriver class.
   */
  public function __construct(public readonly string $id, public readonly ?string $deriver = NULL) {
  }

}

Classes

Title Deprecated Summary
Plugin Defines a Plugin attribute object.

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