Classes, traits, and interfaces - Drupal 11.1.x - Drupal Core
Primary tabs
Introduction to classes
A lot of the PHP code in Drupal is object oriented (OO), making use of PHP classes, interfaces, and traits. See the Objected-oriented programming conventions for more information.
See also
Objected-oriented programming conventions
File
-
core/
core.api.php, line 1518
Name | Deprecated | Object type | Namespace | File name | Summary | Direct uses | Use statements | Strings |
---|---|---|---|---|---|---|---|---|
ForbiddenCommentsSniff | class | SlevomatCodingStandard\Sniffs\Commenting | vendor/ |
|||||
ForbiddenFunctionsSniff | class | PHP_CodeSniffer\Standards\Generic\Sniffs\PHP | vendor/ |
3 | 2 | |||
ForbiddenPublicPropertySniff | final class | SlevomatCodingStandard\Sniffs\Classes | vendor/ |
|||||
ForbiddenStylesSniff | class | PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS | vendor/ |
|||||
ForEachLoopDeclarationSniff | class | PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures | vendor/ |
|||||
Foreach_ | class | PhpParser\Node\Stmt | vendor/ |
1 | ||||
ForInStatement | class | Peast\Syntax\Node | vendor/ |
A node that represents a for-in statement. For example: for (var a in b) {} | 1 | |||
ForkCMSInstaller | class | Composer\Installers | vendor/ |
|||||
ForLoopDeclarationSniff | class | PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures | vendor/ |
|||||
ForLoopInfo | class | VariableAnalysis\Lib | vendor/ |
Holds details of a for loop. | 1 | |||
ForLoopNode | class | Twig\Node | vendor/ |
Internal node used by the for node. | ||||
ForLoopShouldBeWhileLoopSniff | class | PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis | vendor/ |
|||||
ForLoopWithTestFunctionCallSniff | class | PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis | vendor/ |
|||||
Form | class | Drupal\Core\Render\Element | core/ |
Provides a render element for a form. | ||||
Form | class | Symfony\Component\DomCrawler | vendor/ |
Form represents an HTML form. | 2 | |||
FormAjaxException | class | Drupal\Core\Form | core/ |
Custom exception to break out of AJAX form processing. | 1 | |||
FormAjaxResponseBuilder | class | Drupal\Core\Form | core/ |
Builds an AJAX form response. | ||||
FormAjaxResponseBuilderInterface | interface | Drupal\Core\Form | core/ |
Provides an interface for building AJAX form responses. | 1 | 1 | ||
FormAjaxSubscriber | class | Drupal\Core\Form\EventSubscriber | core/ |
Wraps AJAX form submissions that are triggered via an exception. | ||||
FormAlterDocSniff | class | DrupalPractice\Sniffs\FunctionDefinitions | vendor/ |
Checks that the comment "Implements hook_form_alter()." actually matches the function signature. | ||||
FormatConstraint | class | JsonSchema\Constraints | vendor/ |
Validates against the "format" property | ||||
FormatDate | class | Drupal\migrate\Plugin\migrate\process | core/ |
Converts date/datetime from one format to another. | ||||
FormattableMarkup | class | Drupal\Component\Render | core/ |
Formats a string for HTML display by replacing variable placeholders. | 1 | 33 | ||
FormattedDateDiff | class | Drupal\Core\Datetime | core/ |
Contains a formatted time difference. | ||||
Formatter | class | OpenTelemetry\API\Behavior\Internal\LogWriter | vendor/ |
|||||
Formatter | interface | phpDocumentor\Reflection\DocBlock\Tags | vendor/ |
2 | 5 | |||
FormatterBase | abstract class | Drupal\Core\Field | core/ |
Base class for 'Field formatter' plugin implementations. | 24 | 24 | ||
FormatterHelper | class | Symfony\Component\Console\Helper | vendor/ |
The Formatter class provides helpers to format messages. | 2 | |||
FormatterInterface | interface | Drupal\Core\Field | core/ |
Interface definition for field formatter plugins. | 1 | 2 | 1 | |
FormatterPluginManager | class | Drupal\Core\Field | core/ |
Plugin type manager for field formatters. | 3 | |||
FormBase | abstract class | Drupal\Core\Form | core/ |
Provides a base class for forms. | 54 | 52 | ||
FormBuilder | class | Drupal\Core\Form | core/ |
Provides form building and processing. | ||||
FormBuilderInterface | interface | Drupal\Core\Form | core/ |
Provides an interface for form building and processing. | 1 | 21 | ||
FormCache | class | Drupal\Core\Form | core/ |
Encapsulates the caching of a form and its form state. | ||||
FormCacheInterface | interface | Drupal\Core\Form | core/ |
Provides an interface for the caching of a form and its form state. | 2 | |||
FormController | abstract class | Drupal\Core\Controller | core/ |
Common base class for form interstitial controllers. | 4 | 3 | ||
FormDataPart | final class | Symfony\Component\Mime\Part\Multipart | vendor/ |
Implements RFC 7578. | 2 | |||
FormElement | class | Drupal\Core\Render\Annotation | core/ |
Defines a form element plugin annotation object. | ||||
FormElement | class | Drupal\Core\Render\Attribute | core/ |
Defines a form element plugin attribute object. | 37 | |||
FormElement | in drupal:10.3.0 and is removed from drupal:12.0.0. use \Drupal\Core\Render\Element\FormElementBase instead. |
abstract class | Drupal\Core\Render\Element | core/ |
Provides a base class for form element plugins. | |||
FormElementBase | abstract class | Drupal\Core\Render\Element | core/ |
Provides a base class for form element plugins. | 28 | 3 | ||
FormElementBase | abstract class | Drupal\config_translation\FormElement | core/ |
Provides a common base class for form elements. | 5 | |||
FormElementHelper | class | Drupal\Core\Form | core/ |
Provides common functionality for form elements. | 1 | |||
FormElementInterface | interface | Drupal\Core\Render\Element | core/ |
Provides an interface for form element plugins. | 1 | 1 | ||
FormErrorHandler | class | Drupal\Core\Form | core/ |
Handles form errors. | 1 | 1 | ||
FormErrorHandler | class | Drupal\inline_form_errors | core/ |
Produces inline form errors. | ||||
FormErrorHandlerInterface | interface | Drupal\Core\Form | core/ |
Provides an interface for handling form errors. | 1 | |||
FormErrorNormalizer | final class | Symfony\Component\Serializer\Normalizer | vendor/ |
Normalizes invalid Form instances. | 1 | |||
FormErrorNormalizerContextBuilder | final class | Symfony\Component\Serializer\Context\Normalizer | vendor/ |
A helper providing autocompletion for available FormErrorNormalizer options. | ||||
FormErrorTSniff | class | DrupalPractice\Sniffs\FunctionCalls | vendor/ |
Verifies that messages passed to form_set_error() run through t(). |