class FormElement

Same name in this branch
  1. 11.x core/lib/Drupal/Core/Render/Element/FormElement.php \Drupal\Core\Render\Element\FormElement
  2. 11.x core/lib/Drupal/Core/Render/Annotation/FormElement.php \Drupal\Core\Render\Annotation\FormElement
Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Render/Element/FormElement.php \Drupal\Core\Render\Element\FormElement
  2. 9 core/lib/Drupal/Core/Render/Annotation/FormElement.php \Drupal\Core\Render\Annotation\FormElement
  3. 8.9.x core/lib/Drupal/Core/Render/Element/FormElement.php \Drupal\Core\Render\Element\FormElement
  4. 8.9.x core/lib/Drupal/Core/Render/Annotation/FormElement.php \Drupal\Core\Render\Annotation\FormElement
  5. 10 core/lib/Drupal/Core/Render/Element/FormElement.php \Drupal\Core\Render\Element\FormElement
  6. 10 core/lib/Drupal/Core/Render/Annotation/FormElement.php \Drupal\Core\Render\Annotation\FormElement
  7. 10 core/lib/Drupal/Core/Render/Attribute/FormElement.php \Drupal\Core\Render\Attribute\FormElement

Defines a form element plugin attribute object.

See \Drupal\Core\Render\Element\FormElementInterface for more information about form element plugins.

Plugin Namespace: Element

For a working example, see \Drupal\Core\Render\Element\Textfield.

Attributes

#[\Attribute(\Attribute::TARGET_CLASS)]

Hierarchy

Expanded class hierarchy of FormElement

See also

\Drupal\Core\Render\ElementInfoManager

\Drupal\Core\Render\Element\FormElementInterface

\Drupal\Core\Render\Element\FormElementBase

\Drupal\Core\Render\Attribute\RenderElement

Plugin API

Related topics

38 files declare their use of FormElement
Button.php in core/lib/Drupal/Core/Render/Element/Button.php
Checkbox.php in core/lib/Drupal/Core/Render/Element/Checkbox.php
Checkboxes.php in core/lib/Drupal/Core/Render/Element/Checkboxes.php
Color.php in core/lib/Drupal/Core/Render/Element/Color.php
Date.php in core/lib/Drupal/Core/Render/Element/Date.php

... See full list

File

core/lib/Drupal/Core/Render/Attribute/FormElement.php, line 25

Namespace

Drupal\Core\Render\Attribute
View source
class FormElement extends RenderElement {

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AttributeBase::$class protected property The class used for this attribute class.
AttributeBase::$provider protected property The provider of the attribute class.
AttributeBase::get public function Gets the value of an attribute. Overrides AttributeInterface::get 7
AttributeBase::getClass public function Gets the class of the attribute class. Overrides AttributeInterface::getClass 1
AttributeBase::getId public function Gets the unique ID for this attribute class. Overrides AttributeInterface::getId
AttributeBase::getProvider public function Gets the name of the provider of the attribute class. Overrides AttributeInterface::getProvider
AttributeBase::setClass public function Sets the class of the attributed class. Overrides AttributeInterface::setClass 1
AttributeBase::setProvider public function Sets the name of the provider of the attribute class. Overrides AttributeInterface::setProvider 1
Plugin::__construct public function Constructs a plugin attribute object. Overrides AttributeBase::__construct 51

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