class Label

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Render/Element/Label.php \Drupal\Core\Render\Element\Label
  2. 8.9.x core/lib/Drupal/Core/Render/Element/Label.php \Drupal\Core\Render\Element\Label
  3. 10 core/lib/Drupal/Core/Render/Element/Label.php \Drupal\Core\Render\Element\Label

Provides a render element for displaying the label for a form element.

Labels are generated automatically from element properties during processing of most form elements. This element is used internally by the form system to render labels for form elements.

Attributes

#[RenderElement('label')]

Hierarchy

Expanded class hierarchy of Label

270 string references to 'Label'
Action::create in core/modules/system/src/Entity/Action.php
Constructs a new entity object, without permanently saving it.
Action::prepareRow in core/modules/system/src/Plugin/migrate/source/Action.php
Adds additional data to the row.
ActionAddForm::buildForm in core/modules/action/src/Form/ActionAddForm.php
ActionFormBase::form in core/modules/action/src/Form/ActionFormBase.php
Gets the actual form array to be built.
ActionListBuilder::buildHeader in core/modules/action/src/ActionListBuilder.php
Builds the header row for the entity listing.

... See full list

3 #type uses of Label
FieldStorageAddController::getFieldSelectionLinks in core/modules/field_ui/src/Controller/FieldStorageAddController.php
Builds the field selection links.
FieldStorageAddForm::buildForm in core/modules/field_ui/src/Form/FieldStorageAddForm.php
Form constructor.
FormElementLabelTest::testAttributes in core/modules/system/tests/src/Kernel/Form/FormElementLabelTest.php
Ensures that attributes can be placed for form element label.

File

core/lib/Drupal/Core/Render/Element/Label.php, line 14

Namespace

Drupal\Core\Render\Element
View source
class Label extends RenderElementBase {
  
  /**
   * {@inheritdoc}
   */
  public function getInfo() {
    return [
      '#theme' => 'form_element_label',
    ];
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
Label::getInfo public function Returns the element properties for this element. Overrides ElementInterface::getInfo
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 7
PluginInspectionInterface::getPluginId public function Gets the plugin ID of the plugin instance. 3
RenderElementBase::$renderParent protected property The parent element.
RenderElementBase::$renderParentName protected property The parent key.
RenderElementBase::$storage protected property The storage.
RenderElementBase::addChild public function Adds a child render element. Overrides ElementInterface::addChild
RenderElementBase::changeType public function Change the type of the element. Overrides ElementInterface::changeType
RenderElementBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create 2
RenderElementBase::createChild public function Creates a render object and attaches it to the current render object. Overrides ElementInterface::createChild
RenderElementBase::elementInfoManager protected function Returns the element info manager.
RenderElementBase::getChild public function Gets a child. Overrides ElementInterface::getChild
RenderElementBase::getChildren public function Returns child elements. Overrides ElementInterface::getChildren
RenderElementBase::initializeInternalStorage public function Initialize storage. Overrides ElementInterface::initializeInternalStorage
RenderElementBase::preRenderAjaxForm public static function Adds Ajax information about an element to communicate with JavaScript. 2
RenderElementBase::preRenderGroup public static function Adds members of this group as actual elements for rendering. 2
RenderElementBase::processAjaxForm public static function Form element processing handler for the #ajax form property. 3
RenderElementBase::processGroup public static function Arranges elements into groups. 2
RenderElementBase::removeChild public function Removes a child. Overrides ElementInterface::removeChild
RenderElementBase::setAttributes public static function Sets a form element's class attribute. Overrides ElementInterface::setAttributes 2
RenderElementBase::setType protected function Set type on initialize. 1
RenderElementBase::toRenderable public function Returns a render array. Overrides ElementInterface::toRenderable
RenderElementBase::__construct public function Constructs a new render element object. 6
RenderElementBase::__get public function Magic method: gets a property value.
RenderElementBase::__isset public function Magic method: checks if a property value is set.
RenderElementBase::__set public function Magic method: Sets a property value.
RenderElementBase::__sleep public function
RenderElementBase::__unset public function Magic method: unsets a property value.
RenderElementBase::__wakeup public function

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