Classes and Interfaces¶
This page highlights the classes most developers interact with.
Field API plugins¶
Drupal\name\Plugin\Field\FieldType\NameItem- field schema and settings for
namevalues Drupal\name\Plugin\Field\FieldWidget\NameWidget- form input for each component
Drupal\name\Plugin\Field\FieldFormatter\NameFormatter- render-time formatter plugin that delegates to
name.formatter
Form and render classes¶
Drupal\name\Element\Name- composite form element (
#type => 'name') Drupal\name\Controller\AutocompleteController- endpoint that delegates matching to
name.autocomplete
Service interfaces (preferred type hints)¶
Drupal\name\Service\NameFormatterInterfaceDrupal\name\Service\NameFormatParserInterfaceDrupal\name\Service\GeneratorInterfaceDrupal\name\Service\AutocompleteInterfaceDrupal\name\Service\NameOptionInterfaceDrupal\name\Service\WidgetLayoutInterface
Config entity classes¶
Drupal\name\Entity\NameFormatDrupal\name\Entity\NameListFormatDrupal\name\Entity\NameFormatInterfaceDrupal\name\Entity\NameListFormatInterface
Integration classes¶
- Feeds:
Drupal\name\Feeds\Target\NameTarget - Diff:
Drupal\name\Plugin\diff\Field\NameFieldBuilder - Views filter:
Drupal\name\Plugin\views\filter\Fulltext - Migrate plugin:
Drupal\name\Plugin\migrate\field\NameField - Migrate process plugin:
Drupal\name\Plugin\migrate\process\NameField
Example: class-based DI¶
use Drupal\name\Service\NameFormatterInterface;
final class NamePresenter {
public function __construct(
private readonly NameFormatterInterface $formatter,
) {}
}