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
HtmlRenderer class Drupal\Core\Render\MainContent core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php Default main content renderer for HTML requests. 2
HtmlResponse class Drupal\Core\Render core/lib/Drupal/Core/Render/HtmlResponse.php Response that contains and can expose cacheability metadata and attachments. 1 18
HtmlResponseAttachmentsProcessor class Drupal\Core\Render core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php Processes attachments of HTML responses. 1 1 2
HtmlResponseAttachmentsTest class Drupal\Tests\system\Functional\Render core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php Functional tests for HtmlResponseAttachmentsProcessor.
HtmlResponseBigPipeSubscriber class Drupal\big_pipe\EventSubscriber core/modules/big_pipe/src/EventSubscriber/HtmlResponseBigPipeSubscriber.php Response subscriber to replace the HtmlResponse with a BigPipeResponse. 2
HtmlResponsePlaceholderStrategySubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/HtmlResponsePlaceholderStrategySubscriber.php HTML response subscriber to allow for different placeholder strategies. 2
HtmlResponseSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/HtmlResponseSubscriber.php Response subscriber to handle HTML responses. 2
HTMLRestrictions final class Drupal\ckeditor5 core/modules/ckeditor5/src/HTMLRestrictions.php Represents a set of HTML restrictions. 19
HTMLRestrictionsTest class Drupal\Tests\ckeditor5\Unit core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php Tests Drupal\ckeditor5\HTMLRestrictions.
HtmlSerializerRules class Drupal\Component\Utility core/lib/Drupal/Component/Utility/HtmlSerializerRules.php Drupal-specific HTML5 serializer rules.
HtmlTag class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/HtmlTag.php Provides a render element for any HTML tag, with properties and value. 1
HtmlTagTest class Drupal\Tests\Core\Render\Element core/tests/Drupal/Tests/Core/Render/Element/HtmlTagTest.php Tests Drupal\Core\Render\Element\HtmlTag.
HtmlTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/HtmlTest.php Tests \Drupal\Component\Utility\Html.
HtmlTestMarkup class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/HtmlTest.php Marks an object's __toString() method as returning markup.
HtmlToTextTest class Drupal\Tests\system\Unit\Mail core/modules/system/tests/src/Unit/Mail/HtmlToTextTest.php Tests for \Drupal\Core\Mail\MailFormatHelper::htmlToText().
Htmx class Drupal\Core\Htmx core/lib/Drupal/Core/Htmx/Htmx.php Presents the HTMX controls for developers to use with render arrays. 8
HtmxAssetLoadTestSetup class Drupal\TestSite core/tests/Drupal/TestSite/HtmxAssetLoadTestSetup.php Setup file used by tests/src/Nightwatch/Tests/htmxAssetLoadTest.js.
HtmxAttributesTest class Drupal\Tests\Core\Htmx core/tests/Drupal/Tests/Core/Htmx/HtmxAttributesTest.php Test all attribute-related Htmx public methods.
HtmxContentViewSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/HtmxContentViewSubscriber.php View subscriber rendering main content from `_htmx_route` option routes. 2
HtmxDynamicFormTest class Drupal\FunctionalJavascriptTests\Core\Htmx core/tests/Drupal/FunctionalJavascriptTests/Core/Htmx/HtmxDynamicFormTest.php Tests that dynamic forms powered by HTMX work as expected.
HtmxHeadersTest class Drupal\Tests\Core\Htmx core/tests/Drupal/Tests/Core/Htmx/HtmxHeadersTest.php Test all header-related Htmx public methods.
HtmxLocationResponseData class Drupal\Core\Htmx core/lib/Drupal/Core/Htmx/HtmxLocationResponseData.php Optional data object for HX-Location. 1
HtmxRenderer class Drupal\Core\Render\MainContent core/lib/Drupal/Core/Render/MainContent/HtmxRenderer.php Main content renderer for HTMX requests. 2 2
HtmxRendererCacheTest class Drupal\FunctionalTests\Htmx core/tests/Drupal/FunctionalTests/Htmx/HtmxRendererCacheTest.php Tests the cache headers set HtmxRenderer responses.
HtmxRendererTest class Drupal\KernelTests\Core\Htmx core/tests/Drupal/KernelTests/Core/Htmx/HtmxRendererTest.php Verifies HtmxRenderer.
HtmxRequestInfoTest class Drupal\Tests\Core\Htmx core/tests/Drupal/Tests/Core/Htmx/HtmxRequestInfoTest.php Test all HtmxRequestInfoTrait methods.
HtmxRequestInfoTrait trait Drupal\Core\Htmx core/lib/Drupal/Core/Htmx/HtmxRequestInfoTrait.php Provides methods for getting information about the HTMX request. 2
HtmxRequestTest class Drupal\KernelTests\Core\Htmx core/tests/Drupal/KernelTests/Core/Htmx/HtmxRequestTest.php Test the request attributes for HTMX.
HtmxTestAjaxForm class Drupal\test_htmx\Form core/modules/system/tests/modules/test_htmx/src/Form/HtmxTestAjaxForm.php A small form used to insert an HTMX powered element using ajax API. 1
HtmxTestAttachmentsController final class Drupal\test_htmx\Controller core/modules/system/tests/modules/test_htmx/src/Controller/HtmxTestAttachmentsController.php Returns responses for HTMX Test Attachments routes. 1
HtmxTestForm class Drupal\test_htmx\Form core/modules/system/tests/modules/test_htmx/src/Form/HtmxTestForm.php A small form used to test HTMX dynamic forms. 1
HtmxUtilitiesTest class Drupal\Tests\Core\Htmx core/tests/Drupal/Tests/Core/Htmx/HtmxUtilitiesTest.php Test all Htmx public utility methods.
HtRouterTest class Drupal\BuildTests\Framework\Tests core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php Tests Drupal\BuildTests\Framework\BuildTestBase.
Http4xxController class Drupal\system\Controller core/modules/system/src/Controller/Http4xxController.php Controller for default HTTP 4xx responses.
HttpExceptionNormalizer class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/HttpExceptionNormalizer.php Normalizes an HttpException in compliance with the JSON:API specification. 2 4 2
HttpExceptionNormalizerTest class Drupal\Tests\jsonapi\Unit\Normalizer core/modules/jsonapi/tests/src/Unit/Normalizer/HttpExceptionNormalizerTest.php Tests Drupal\jsonapi\Normalizer\HttpExceptionNormalizer.
HttpExceptionNormalizerValue class Drupal\jsonapi\Normalizer\Value core/modules/jsonapi/src/Normalizer/Value/HttpExceptionNormalizerValue.php Helps normalize exceptions in compliance with the JSON:API spec. 2
HttpExceptionSubscriberBase abstract class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php Utility base class for exception subscribers. 6 2
HttpKernelUiHelperTrait trait Drupal\Tests core/tests/Drupal/Tests/HttpKernelUiHelperTrait.php Provides UI helper methods using the HTTP kernel to make requests. 4
HTTPStatusCode class Drupal\views\Plugin\views\area core/modules/views/src/Plugin/views/area/HTTPStatusCode.php Alter the HTTP response status code used by the view.
HWLDFWordAccumulator class Drupal\Component\Diff\Engine core/lib/Drupal/Component/Diff/Engine/HWLDFWordAccumulator.php @todo document @private @subpackage DifferenceEngine 2
HWLDFWordAccumulatorTest class Drupal\Tests\Component\Diff\Engine core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php Test HWLDFWordAccumulator.
I18nQueryTrait trait Drupal\migrate_drupal\Plugin\migrate\source core/modules/migrate_drupal/src/Plugin/migrate/source/I18nQueryTrait.php Gets an i18n translation from the source database. 4
I18nQueryTraitTest class Drupal\Tests\migrate_drupal\Kernel core/modules/migrate_drupal/tests/src/Kernel/I18nQueryTraitTest.php Tests instantiating migrate source plugins using I18nQueryTrait.
Icon class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Icon.php Provides a render element to display an icon. 1
IconBuilderInterface interface Drupal\Core\Layout\Icon core/lib/Drupal/Core/Layout/Icon/IconBuilderInterface.php Provides an interface for building layout icons. 1
IconBuilderTest class Drupal\KernelTests\Core\Layout core/tests/Drupal/KernelTests/Core/Layout/IconBuilderTest.php Tests Drupal\Core\Layout\Icon\SvgIconBuilder.
IconCollector class Drupal\Core\Theme\Icon core/lib/Drupal/Core/Theme/Icon/IconCollector.php A CacheCollector implementation for building icons info. 2
IconDefinition class Drupal\Core\Theme\Icon core/lib/Drupal/Core/Theme/Icon/IconDefinition.php Handle an icon definition. 11
IconDefinitionInterface interface Drupal\Core\Theme\Icon core/lib/Drupal/Core/Theme/Icon/IconDefinitionInterface.php Interface for icon definition. 1 7

Other projects


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