|
Tripal
|


Public Member Functions | |
| __construct (public readonly string $id, public readonly ?TranslatableMarkup $label=NULL, public readonly ?TranslatableMarkup $description=NULL, public readonly array $field_types=[], public readonly ?int $weight=NULL, public readonly ?string $deriver=NULL, public readonly ?array $valid_tokens=[],) | |
Defines a TripalFieldFormatter attribute for plugin discovery.
This extends the Drupal core FieldFormatter attribute by adding support for a "valid_tokens" setting.
| Drupal\tripal\TripalField\Attribute\TripalFieldFormatter::__construct | ( | public readonly string | $id, |
| public readonly ?TranslatableMarkup | $label = NULL, |
||
| public readonly ?TranslatableMarkup | $description = NULL, |
||
| public readonly array | $field_types = [], |
||
| public readonly ?int | $weight = NULL, |
||
| public readonly ?string | $deriver = NULL, |
||
| public readonly ?array | $valid_tokens = [] |
||
| ) |
Constructs a TripalFieldFormatter attribute.
| string | $id | The plugin ID. |
| \Drupal\Core\StringTranslation\TranslatableMarkup | null | $label | (optional) The human-readable name of the formatter type. |
| \Drupal\Core\StringTranslation\TranslatableMarkup | null | $description | (optional) A short description of the formatter type. |
| string[] | $field_types | (optional) An array of field types the formatter supports. |
| int | null | $weight | (optional) An integer to determine the weight of this formatter. Weight is relative to other formatters in the Field UI when selecting a formatter for a given field instance. |
| class-string | null | $deriver | (optional) The deriver class. |
| array | null | $valid_tokens | (optional) A list of one or more tokens in square brackets that are valid for this formatter, e.g. ['[name]', '[title]']. |