Label.php

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

Namespace

Drupal\Core\Render\Element

File

core/lib/Drupal/Core/Render/Element/Label.php

View source
<?php

namespace Drupal\Core\Render\Element;

use Drupal\Core\Render\Attribute\RenderElement;

/**
 * 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.
 */
class Label extends RenderElementBase {
    
    /**
     * {@inheritdoc}
     */
    public function getInfo() {
        return [
            '#theme' => 'form_element_label',
        ];
    }

}

Classes

Title Deprecated Summary
Label Provides a render element for displaying the label for a form element.

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