fieldry-1.0.x-dev/src/Attribute/FieldryWrapper.php
src/Attribute/FieldryWrapper.php
<?php
namespace Drupal\fieldry\Attribute;
use Drupal\Component\Plugin\Attribute\Plugin;
/**
* Defines the field wrapper plugin attribute.
*
* Plugin Namespace: Plugin\fieldry\FieldWrapper.
*
* @see Drupal\Component\Annotation\Plugin
* @see Drupal\fieldry\Plugin\FieldWrapperInterface
* @see Drupal\fieldry\Plugin\FieldWrapperPluginManager
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
class FieldryWrapper extends Plugin {
/**
* Creates a new instance of the GieldryWrapper plugin attribute.
*
* @param string $id
* The base plugin ID to use for plugin definition.
* @param \Stringable|string $label
* Display name for this plugin.
* @param string $theme
* Machine name of the theme to use when rendering this field.
* @param array $fieldTypes
* The field types that can use this field wrapper. Empty allows any types.
*/
public function __construct(
public readonly string $id,
public readonly \Stringable|string $label,
public readonly string $theme = 'fieldry_wrapper',
public readonly array $fieldTypes = [],
) {}
}
