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
HookHelpSection class Drupal\help\Plugin\HelpSection core/modules/help/src/Plugin/HelpSection/HookHelpSection.php Provides the module topics list section for the help page.
HookLoaderTest class Drupal\KernelTests\Core\Hook core/tests/Drupal/KernelTests/Core/Hook/HookLoaderTest.php Test hook loading.
HookOrderTest class Drupal\KernelTests\Core\Hook core/tests/Drupal/KernelTests/Core/Hook/HookOrderTest.php Tests Hook Order.
HookOrderTestTrait trait Drupal\KernelTests\Core\Hook core/tests/Drupal/KernelTests/Core/Hook/HookOrderTestTrait.php Provides methods to support testing hooks.
HookRequirementsTest class Drupal\Tests\system\Functional\Module core/modules/system/tests/src/Functional/Module/HookRequirementsTest.php Attempts enabling a module that fails hook_requirements('install').
HtaccessTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/HtaccessTest.php Tests .htaccess is working correctly.
HtaccessTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/HtaccessTest.php Tests .htaccess file saving.
HtaccessWriter class Drupal\Core\File core/lib/Drupal/Core/File/HtaccessWriter.php Provides functions to manage Apache .htaccess files. 1 2
HtaccessWriterInterface interface Drupal\Core\File core/lib/Drupal/Core/File/HtaccessWriterInterface.php Interface for managing Apache .htaccess files. 1
Html class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Html.php Provides DOMDocument helpers for parsing and serializing HTML strings. 219
Html class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Html.php Provides a render element for an entire HTML page: <html> plus its children.
HtmlAttributesTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/HtmlAttributesTest.php Tests attributes inserted in the 'html' and 'body' elements on the page.
HtmlCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/HtmlCommand.php AJAX command for calling the jQuery html() method. 7
HtmlEntityFormController class Drupal\Core\Entity core/lib/Drupal/Core/Entity/HtmlEntityFormController.php Wrapping controller for entity forms that serve as the main page body. 2
HtmlEscapedText class Drupal\Component\Render core/lib/Drupal/Component/Render/HtmlEscapedText.php Escapes HTML syntax characters to HTML entities for display in markup. 2
HtmlEscapedTextTest class Drupal\Tests\Component\Render core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php Tests the HtmlEscapedText class.
HtmlFormController class Drupal\Core\Controller core/lib/Drupal/Core/Controller/HtmlFormController.php Wrapping controller for forms that serve as the main page body. 2
HtmlList class Drupal\views\Plugin\views\style core/modules/views/src/Plugin/views/style/HtmlList.php Style plugin to render each item in an ordered or unordered list.
HtmlOutputLogger final class Drupal\TestTools\Extension\HtmlLogging core/tests/Drupal/TestTools/Extension/HtmlLogging/HtmlOutputLogger.php Drupal's extension for providing HTML output results for functional tests. 1
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

Other projects


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