CustomPlugin.php

Same filename in this branch
  1. 11.x core/tests/Drupal/Tests/Component/Plugin/Attribute/Fixtures/CustomPlugin.php
Same filename and directory in other branches
  1. 10 core/tests/Drupal/Tests/Component/Plugin/Attribute/Fixtures/CustomPlugin.php
  2. 10 core/tests/fixtures/plugins/CustomPlugin.php

Namespace

com\example\PluginNamespace

File

core/tests/fixtures/plugins/CustomPlugin.php

View source
<?php

declare (strict_types=1);
namespace com\example\PluginNamespace;

use Drupal\Component\Plugin\Attribute\Plugin;

/**
 * Custom plugin attribute.
 */
class CustomPlugin extends Plugin {
  
  /**
   * Constructs a CustomPlugin attribute object.
   *
   * @param string $id
   *   The attribute class ID.
   * @param string $title
   *   The title.
   */
  public function __construct(public readonly string $id, public readonly string $title) {
  }

}

/**
 * Custom plugin attribute.
 */
class CustomPlugin2 extends Plugin {

}

Classes

Title Deprecated Summary
CustomPlugin Custom plugin attribute.
CustomPlugin2 Custom plugin attribute.

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