Classes, traits, and interfaces - 10.3.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 1518

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
RemoveSectionForm class Drupal\layout_builder\Form core/modules/layout_builder/src/Form/RemoveSectionForm.php Provides a form to confirm the removal of a section. 1
RenderableInterface interface Drupal\Core\Render core/lib/Drupal/Core/Render/RenderableInterface.php Defines an object which can be rendered by the Render API. 4 7
RenderArrayNonHtmlSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/RenderArrayNonHtmlSubscriber.php Throws 406 if requesting non-HTML format and controller returns render array. 2
RenderArrayNonHtmlSubscriberTest class Drupal\Tests\system\Functional\Render core/modules/system/tests/src/Functional/Render/RenderArrayNonHtmlSubscriberTest.php Functional test verifying that render array throws 406 for non-HTML requests.
RenderArrayNonHtmlSubscriberTestController class Drupal\render_array_non_html_subscriber_test core/modules/system/tests/modules/render_array_non_html_subscriber_test/src/RenderArrayNonHtmlSubscriberTestController.php
RenderAttachedTestController class Drupal\render_attached_test\Controller core/modules/system/tests/modules/render_attached_test/src/Controller/RenderAttachedTestController.php Controller for various permutations of #attached in the render array. 1
RenderCache class Drupal\Core\Render core/lib/Drupal/Core/Render/RenderCache.php Wraps the caching logic for the render caching system. 1
RenderCacheIntegrationTest class Drupal\Tests\views\Kernel core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php Tests the general integration between views and the render cache.
RenderCacheInterface interface Drupal\Core\Render core/lib/Drupal/Core/Render/RenderCacheInterface.php Defines an interface for caching rendered render arrays. 1 2
RenderCacheTest class Drupal\KernelTests\Core\Render core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php Tests the caching of render items via functional tests.
RenderCacheWebTest class Drupal\Tests\views\Functional core/modules/views/tests/src/Functional/RenderCacheWebTest.php Tests render caching of blocks provided by views.
RenderCallbackInterface interface Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/RenderCallbackInterface.php Indicates all public methods are safe to use in render callbacks. 3 3
RenderCallbacks final class Drupal\announcements_feed core/modules/announcements_feed/src/RenderCallbacks.php Defines a class for render callbacks. 1
RenderCallbacks final class Drupal\navigation core/modules/navigation/src/RenderCallbacks.php Defines a class for render element callbacks. 1
RenderContext class Drupal\Core\Render core/lib/Drupal/Core/Render/RenderContext.php The render context: a stack containing bubbleable rendering metadata. 42
RenderedEntity class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/RenderedEntity.php Provides a field handler which renders an entity in a certain view mode. 1
RenderedEntityTest class Drupal\Tests\views\Unit\Plugin\views\field core/modules/views/tests/src/Unit/Plugin/views/field/RenderedEntityTest.php @coversDefaultClass \Drupal\views\Plugin\views\field\RenderedEntity[[api-linebreak]] @group Views
RenderElement

in drupal:10.3.0 and is removed from drupal:12.0.0. Use \Drupal\Core\Render\Element\RenderElementBase instead.

abstract class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/RenderElement.php Provides a base class for render element plugins. 1 1
RenderElement class Drupal\Core\Render\Annotation core/lib/Drupal/Core/Render/Annotation/RenderElement.php Defines a render element plugin annotation object. 1
RenderElement class Drupal\Core\Render\Attribute core/lib/Drupal/Core/Render/Attribute/RenderElement.php Defines a Render element plugin attribute object. 1 37
RenderElementBase abstract class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/RenderElementBase.php Provides a base class for render element plugins. 32 15
RenderElementHelper class Drupal\inline_form_errors core/modules/inline_form_errors/src/RenderElementHelper.php Provides functionality to process render elements. 1
RenderElementTest class Drupal\Tests\Core\Render\Element core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php @coversDefaultClass \Drupal\Core\Render\Element\RenderElementBase[[api-linebreak]] @group Render
RenderElementTypesTest class Drupal\KernelTests\Core\Render\Element core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php Tests the rendered markup of core render element types.
Renderer class Drupal\Core\Render core/lib/Drupal/Core/Render/Renderer.php Turns a render array into an HTML string. 4 2
RendererBase abstract class Drupal\views\Entity\Render core/modules/views/src/Entity/Render/RendererBase.php Defines a base class for entity renderers. 2
RendererBubblingTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @group Render
RendererCallbackTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @group Render
RendererDebugTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererDebugTest.php @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @group Render
RendererInterface interface Drupal\Core\Render core/lib/Drupal/Core/Render/RendererInterface.php Defines an interface for turning a render array into a string. 1 74
RendererPlaceholdersTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @covers \Drupal\Core\Render\RenderCache[[api-linebreak]] @covers \Drupal\Core\Render\PlaceholderingRenderCache[[api-linebreak]] @group Render
RendererRecursionTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @group Render
RendererTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererTest.php @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @group Render
RendererTestBase abstract class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererTestBase.php Base class for the actual unit tests testing \Drupal\Core\Render\Renderer. 8 1
RenderEvents final class Drupal\Core\Render core/lib/Drupal/Core/Render/RenderEvents.php Defines events for the render system. 3
RenderPlaceholderMessageTestController class Drupal\render_placeholder_message_test core/modules/system/tests/modules/render_placeholder_message_test/src/RenderPlaceholderMessageTestController.php 2
RenderTest class Drupal\KernelTests\Core\Render core/tests/Drupal/KernelTests/Core/Render/RenderTest.php Performs functional tests on \Drupal::service('renderer')->render().
RenderWebTest class Drupal\Tests\system\Functional\Common core/modules/system/tests/src/Functional/Common/RenderWebTest.php Performs integration tests on \Drupal::service('renderer')->render().
ReorderDisplays class Drupal\views_ui\Form\Ajax core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php Displays the display reorder form.
ReplaceCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/ReplaceCommand.php AJAX command for calling the jQuery replace() method. 12
ReplaceOp class Drupal\Composer\Plugin\Scaffold\Operations composer/Plugin/Scaffold/Operations/ReplaceOp.php Scaffold operation to copy or symlink from source to destination. 2
ReplaceOpTest class Drupal\Tests\Composer\Plugin\Scaffold\Integration core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ReplaceOpTest.php @coversDefaultClass \Drupal\Composer\Plugin\Scaffold\Operations\ReplaceOp[[api-linebreak]]
ReplaceTitleCommand class Drupal\views\Ajax core/modules/views/src/Ajax/ReplaceTitleCommand.php Provides an AJAX command for replacing the page title. 1
ReplicaKillSwitch class Drupal\Core\Database core/lib/Drupal/Core/Database/ReplicaKillSwitch.php Provides replica server kill switch to ignore it. 1 2
ReplicaKillSwitchTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/ReplicaKillSwitchTest.php Tests that ReplicaKillSwitch functions correctly.
ReportFieldsTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/ReportFieldsTest.php Tests the Views fields report page.
ReportTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/ReportTest.php Tests existence of the views plugin report.
RequestContext class Drupal\Core\Routing core/lib/Drupal/Core/Routing/RequestContext.php Holds information about the current request. 11 2
RequestFormatCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/RequestFormatCacheContext.php Defines the RequestFormatCacheContext service, for "per format" caching. 2
RequestFormatRouteFilter class Drupal\Core\Routing core/lib/Drupal/Core/Routing/RequestFormatRouteFilter.php Provides a route filter, which filters by the request format. 1 2 2

Other projects


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