Tripal
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Drupal\tripal\TripalField\Attribute\TripalFieldFormatter Class Reference
Inheritance diagram for Drupal\tripal\TripalField\Attribute\TripalFieldFormatter:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal\TripalField\Attribute\TripalFieldFormatter:
Collaboration graph
[legend]

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=[],)
 

Detailed Description

Defines a TripalFieldFormatter attribute for plugin discovery.

This extends the Drupal core FieldFormatter attribute by adding support for a "valid_tokens" setting.

Constructor & Destructor Documentation

◆ __construct()

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.

Parameters
string$idThe 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]'].

The documentation for this class was generated from the following file: