class Item
Same name in this branch
- 8.9.x core/modules/aggregator/src/Entity/Item.php \Drupal\aggregator\Entity\Item
Same name in other branches
- 9 core/modules/aggregator/src/Entity/Item.php \Drupal\aggregator\Entity\Item
- 9 core/lib/Drupal/Core/Render/Element/Item.php \Drupal\Core\Render\Element\Item
- 10 core/lib/Drupal/Core/Render/Element/Item.php \Drupal\Core\Render\Element\Item
- 11.x core/lib/Drupal/Core/Render/Element/Item.php \Drupal\Core\Render\Element\Item
Provides a display-only form element with an optional title and description.
Note: since this is a read-only field, setting the #required property will do nothing except theme the form element to look as if it were actually required (i.e. by placing a red star next to the #title).
Plugin annotation
@FormElement("item");
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\Core\Render\Element\RenderElement extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Render\Element\ElementInterface
- class \Drupal\Core\Render\Element\FormElement extends \Drupal\Core\Render\Element\RenderElement implements \Drupal\Core\Render\Element\FormElementInterface
- class \Drupal\Core\Render\Element\Item extends \Drupal\Core\Render\Element\FormElement
- class \Drupal\Core\Render\Element\FormElement extends \Drupal\Core\Render\Element\RenderElement implements \Drupal\Core\Render\Element\FormElementInterface
- class \Drupal\Core\Render\Element\RenderElement extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Render\Element\ElementInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of Item
8 string references to 'Item'
- config_test.schema.yml in core/
modules/ config/ tests/ config_test/ config/ schema/ config_test.schema.yml - core/modules/config/tests/config_test/config/schema/config_test.schema.yml
- ContentTranslationHandler::addTranslatabilityClue in core/
modules/ content_translation/ src/ ContentTranslationHandler.php - Adds a clue about the form element translatability.
- FormHelper::processStates in core/
lib/ Drupal/ Core/ Form/ FormHelper.php - Adds JavaScript to change the state of an element based on another element.
- JsonApiDocumentTopLevelNormalizer::normalizeOmissionsLinks in core/
modules/ jsonapi/ src/ Normalizer/ JsonApiDocumentTopLevelNormalizer.php - Normalizes omitted data into a set of omission links.
- MenuLinkTranslationTest::providerSource in core/
modules/ menu_link_content/ tests/ src/ Kernel/ Plugin/ migrate/ source/ d6/ MenuLinkTranslationTest.php - The data provider.
44 #type uses of Item
- AddFormBase::buildEntityFormElement in core/
modules/ media_library/ src/ Form/ AddFormBase.php - Builds the sub-form for setting required fields on a new media item.
- AddHandler::buildForm in core/
modules/ views_ui/ src/ Form/ Ajax/ AddHandler.php - Form constructor.
- AjaxTestImageEffect::ajaxCallback in core/
modules/ image/ tests/ modules/ image_module_test/ src/ Plugin/ ImageEffect/ AjaxTestImageEffect.php - AJAX callback.
- AjaxTestImageEffect::buildConfigurationForm in core/
modules/ image/ tests/ modules/ image_module_test/ src/ Plugin/ ImageEffect/ AjaxTestImageEffect.php - ArgumentPluginBase::buildOptionsForm in core/
modules/ views/ src/ Plugin/ views/ argument/ ArgumentPluginBase.php - Provide a form to edit options for this plugin.
File
-
core/
lib/ Drupal/ Core/ Render/ Element/ Item.php, line 14
Namespace
Drupal\Core\Render\ElementView source
class Item extends FormElement {
/**
* {@inheritdoc}
*/
public function getInfo() {
return [
// Forms that show author fields to both anonymous and authenticated users
// need to dynamically switch between #type 'textfield' and #type 'item'
// to automatically take over the authenticated user's information.
// Therefore, we allow #type 'item' to receive input, which is internally
// assigned by Form API based on the #default_value or #value properties.
'#input' => TRUE,
'#markup' => '',
'#theme_wrappers' => [
'form_element',
],
];
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
FormElement::processAutocomplete | public static | function | Adds autocomplete functionality to elements. | ||
FormElement::processPattern | public static | function | #process callback for #pattern form element property. | ||
FormElement::validatePattern | public static | function | #element_validate callback for #pattern form element property. | ||
FormElement::valueCallback | public static | function | Determines how user input is mapped to an element's #value property. | Overrides FormElementInterface::valueCallback | 15 |
Item::getInfo | public | function | Returns the element properties for this element. | Overrides ElementInterface::getInfo | |
PluginInspectionInterface::getPluginDefinition | public | function | Gets the definition of the plugin implementation. | 6 | |
PluginInspectionInterface::getPluginId | public | function | Gets the plugin_id of the plugin instance. | 2 | |
RenderElement::preRenderAjaxForm | public static | function | Adds Ajax information about an element to communicate with JavaScript. | ||
RenderElement::preRenderGroup | public static | function | Adds members of this group as actual elements for rendering. | ||
RenderElement::processAjaxForm | public static | function | Form element processing handler for the #ajax form property. | 1 | |
RenderElement::processGroup | public static | function | Arranges elements into groups. | ||
RenderElement::setAttributes | public static | function | Sets a form element's class attribute. | Overrides ElementInterface::setAttributes |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.