Classes, traits, and interfaces - 9.5.x - 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 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
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. 2
HtaccessWriterInterface interface Drupal\Core\File core/lib/Drupal/Core/File/HtaccessWriterInterface.php Interface for managing Apache .htaccess files. 1
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.
Html class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Html.php Provides DOMDocument helpers for parsing and serializing HTML strings. 195
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. 11
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.
HtmlOutputPrinter class Drupal\Tests\Listeners core/tests/Drupal/Tests/Listeners/HtmlOutputPrinter.php Defines a class for providing html output results for functional tests. 1
HtmlOutputPrinterTrait trait Drupal\Tests\Listeners core/tests/Drupal/Tests/Listeners/HtmlOutputPrinterTrait.php Defines a class for providing html output results for functional tests.
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 14
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. 25
HTMLRestrictionsTest class Drupal\Tests\ckeditor5\Unit core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php @coversDefaultClass \Drupal\ckeditor5\HTMLRestrictions[[api-linebreak]] @group ckeditor5
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 @coversDefaultClass \Drupal\Core\Render\Element\HtmlTag[[api-linebreak]] @group Render
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\Functional\Mail core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php Tests for \Drupal\Core\Mail\MailFormatHelper::htmlToText().
HtRouterTest class Drupal\BuildTests\Framework\Tests core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php @coversDefaultClass \Drupal\BuildTests\Framework\BuildTestBase[[api-linebreak]] @group Build @requires extension pdo_sqlite
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 @coversDefaultClass \Drupal\jsonapi\Normalizer\HttpExceptionNormalizer[[api-linebreak]] @group jsonapi
HttpExceptionNormalizerValue class Drupal\jsonapi\Normalizer\Value core/modules/jsonapi/src/Normalizer/Value/HttpExceptionNormalizerValue.php Helps normalize exceptions in compliance with the JSON:API spec. 1
HttpExceptionSubscriberBase abstract class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php Utility base class for exception subscribers. 4 1
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\content_translation\Plugin\migrate\source core/modules/content_translation/src/Plugin/migrate/source/I18nQueryTrait.php Gets an i18n translation from the source database. 4
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 @coversDefaultClass \Drupal\Core\Layout\Icon\SvgIconBuilder[[api-linebreak]] @group Layout
IdAuditor class Drupal\migrate\Audit core/modules/migrate/src/Audit/IdAuditor.php Audits migrations that create content entities in the destination system. 5
IdConflictForm class Drupal\migrate_drupal_ui\Form core/modules/migrate_drupal_ui/src/Form/IdConflictForm.php Migrate Upgrade Id Conflict form. 1
IdConflictTest class Drupal\Tests\migrate_drupal_ui\Functional\d6 core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php Tests Drupal 6 Id Conflict page.
IdConflictTest class Drupal\Tests\migrate_drupal_ui\Functional\d7 core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php Tests Drupal 7 Id Conflict page.
IdentifierFieldSchemaTypeUpdateTest class Drupal\Tests\system\Functional\Update core/modules/system/tests/src/Functional/Update/IdentifierFieldSchemaTypeUpdateTest.php Tests the upgrade path for updating the stored type of identifier fields.
IdMapTableNoDummyTest class Drupal\Tests\migrate_drupal\Kernel core/modules/migrate_drupal/tests/src/Kernel/IdMapTableNoDummyTest.php Test that no dummy migrate_map tables are created.
IFrameMarkup class Drupal\media core/modules/media/src/IFrameMarkup.php Defines an object that wraps oEmbed markup for use in an iFrame. 1
IFrameUrlHelper class Drupal\media core/modules/media/src/IFrameUrlHelper.php Providers helper functions for displaying oEmbed resources in an iFrame. 5 2
IFrameUrlHelperTest class Drupal\Tests\media\Unit core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php @coversDefaultClass \Drupal\media\IFrameUrlHelper[[api-linebreak]]
Ignore class Drupal\Core\Config\Schema core/lib/Drupal/Core/Config/Schema/Ignore.php Configuration property to ignore. 2 1

Other projects


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