Classes, traits, and interfaces - main - drupal

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 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
TwigAllowListTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/TwigAllowListTest.php Tests the allowed list of entity properties.
TwigAttributesTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/TwigAttributesTest.php Tests Twig with Attribute objects.
TwigDebugMarkupTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigDebugMarkupTest.php Tests for Twig debug markup.
TwigDeprecationsTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/TwigDeprecationsTest.php Tests deprecating variables passed to twig templates.
TwigEnvironment class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigEnvironment.php A class that defines a Twig environment for Drupal. 4 2
TwigEnvironmentTest class Drupal\Tests\system\Kernel\Theme core/modules/system/tests/src/Kernel/Theme/TwigEnvironmentTest.php Tests Twig environment.
TwigEnvironmentTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php Tests the twig environment.
TwigEnvironmentTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigEnvironmentTest.php Tests Twig environment.
TwigExtension class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigExtension.php A class providing Drupal Twig extensions. 1 2
TwigExtensionPass class Drupal\Core\DependencyInjection\Compiler core/lib/Drupal/Core/DependencyInjection/Compiler/TwigExtensionPass.php Adds the twig_extension_hash parameter to the container. 1
TwigExtensionTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php Tests Twig extensions.
TwigExtensionTest class Drupal\Tests\Core\Template core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php Tests the twig extension.
TwigExtensionTestController class Drupal\twig_extension_test core/modules/system/tests/modules/twig_extension_test/src/TwigExtensionTestController.php Controller routines for Twig extension test routes.
TwigExtensionTestHooks class Drupal\twig_extension_test\Hook core/modules/system/tests/modules/twig_extension_test/src/Hook/TwigExtensionTestHooks.php Hook implementations for twig_extension_test.
TwigExtensionTestString class Drupal\Tests\Core\Template core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php A simple string holder for testing Twig extension.
TwigFilterTest class Drupal\Tests\system\Kernel\Theme core/modules/system/tests/src/Kernel/Theme/TwigFilterTest.php Tests Drupal's Twig filters.
TwigIncludeTest class Drupal\Tests\system\Kernel\Theme core/modules/system/tests/src/Kernel/Theme/TwigIncludeTest.php Tests including files in Twig templates.
TwigLoaderTest class Drupal\Tests\system\Kernel\Theme core/modules/system/tests/src/Kernel/Theme/TwigLoaderTest.php Tests adding Twig loaders.
TwigMarkupInterfaceTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/TwigMarkupInterfaceTest.php Tests Twig with MarkupInterface objects.
TwigNamespaceTest class Drupal\Tests\system\Kernel\Theme core/modules/system/tests/src/Kernel/Theme/TwigNamespaceTest.php Tests Twig namespaces.
TwigNodeCheckDeprecations class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigNodeCheckDeprecations.php A node that checks deprecated variable usage.
TwigNodeTrans class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigNodeTrans.php A class that defines the Twig 'trans' tag for Drupal. 2
TwigNodeVisitor class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigNodeVisitor.php Provides a TwigNodeVisitor to change the generated parse-tree.
TwigNodeVisitorCheckDeprecations class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigNodeVisitorCheckDeprecations.php Provides a Node Visitor to trigger errors if deprecated variables are used.
TwigPhpStorageCache class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigPhpStorageCache.php Provides an alternate cache storage for Twig using PhpStorage. 1
TwigRawTest class Drupal\Tests\system\Kernel\Theme core/modules/system/tests/src/Kernel/Theme/TwigRawTest.php Tests Twig 'raw' filter.
TwigRegistryLoaderTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigRegistryLoaderTest.php Tests Twig registry loader.
TwigSandboxPolicy class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigSandboxPolicy.php Default sandbox policy for Twig templates. 1
TwigSandboxTest class Drupal\Tests\Core\Template core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php Tests the twig sandbox policy.
TwigSettingsTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php Tests overriding Twig engine settings via settings.php.
TwigSimpleCheckToStringNode final class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigSimpleCheckToStringNode.php Defines a twig node for simplifying CheckToStringNode.
TwigThemeEngine class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigThemeEngine.php Twig theme engine. 1
TwigThemeTestController class Drupal\twig_theme_test core/modules/system/tests/modules/twig_theme_test/src/TwigThemeTestController.php Controller routines for Twig theme test routes.
TwigThemeTestHooks class Drupal\twig_theme_test\Hook core/modules/system/tests/modules/twig_theme_test/src/Hook/TwigThemeTestHooks.php Hook implementations for twig_theme_test.
TwigThemeTestUtils class Drupal\twig_theme_test core/modules/system/tests/modules/twig_theme_test/src/TwigThemeTestUtils.php Helper functions used by both test modules and test classes. 2
TwigTransTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigTransTest.php Tests Twig "trans" tags.
TwigTransTokenParser class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigTransTokenParser.php A class that defines the Twig 'trans' token parser for Drupal.
TwoColumnLayout class Drupal\layout_builder\Plugin\Layout core/modules/layout_builder/src/Plugin/Layout/TwoColumnLayout.php Configurable two column layout plugin class. 1
Type class Drupal\node\Plugin\views\argument core/modules/node/src/Plugin/views/argument/Type.php Argument handler to accept a node type.
TypedConfigInterface interface Drupal\Core\Config\Schema core/lib/Drupal/Core/Config/Schema/TypedConfigInterface.php Interface for a typed configuration object that contains multiple elements. 1 1
TypedConfigManager class Drupal\Core\Config core/lib/Drupal/Core/Config/TypedConfigManager.php Manages config schema type plugins. 2 2
TypedConfigManagerInterface interface Drupal\Core\Config core/lib/Drupal/Core/Config/TypedConfigManagerInterface.php Defines an interface for managing config schema type plugins. 1 55
TypedConfigTest class Drupal\KernelTests\Config core/tests/Drupal/KernelTests/Config/TypedConfigTest.php Tests config validation mechanism.
TypedData abstract class Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/TypedData.php The abstract base class for typed data. 14 13
TypedDataAwareValidatorTrait trait Drupal\Core\TypedData\Validation core/lib/Drupal/Core/TypedData/Validation/TypedDataAwareValidatorTrait.php Defines a trait to access the typed data object of a validated value. 6
TypedDataCacheableDependencyInterface interface Drupal\Tests\Core\Plugin\Context core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php Test interface used for mocking.
TypedDataDefinitionEntityBundleTest class Drupal\KernelTests\Core\TypedData core/tests/Drupal/KernelTests/Core/TypedData/TypedDataDefinitionEntityBundleTest.php Tests data type metadata for entity bundles.
TypedDataDefinitionTest class Drupal\KernelTests\Core\TypedData core/tests/Drupal/KernelTests/Core/TypedData/TypedDataDefinitionTest.php Tests deriving metadata of core data types.
TypedDataInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/TypedDataInterface.php Interface for typed data objects. 3 43
TypedDataInternalPropertiesHelper class Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/TypedDataInternalPropertiesHelper.php Helper class for internal properties. 6

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.