class Widget

Provides a widget element.

A form wrapper containing basic properties for the widget, attach the widget elements to this wrapper. This element renders to an empty string.

@property $field_parents The 'parents' space for the field in the form. Most widgets can simply overlook this property. This identifies the location where the field values are placed within $form_state->getValues(), and is used to access processing information for the field through the WidgetBase::getWidgetState() and WidgetBase::setWidgetState() methods. @property $delta The order of this item in the array of sub-elements. (0, 1, 2, etc.)

Attributes

#[RenderElement('widget')]

Hierarchy

Expanded class hierarchy of Widget

5 files declare their use of Widget
OEmbedWidget.php in core/modules/media/src/Plugin/Field/FieldWidget/OEmbedWidget.php
StringTextfieldWidget.php in core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php
TextfieldWidget.php in core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php
WidgetBase.php in core/lib/Drupal/Core/Field/WidgetBase.php
WidgetInterface.php in core/lib/Drupal/Core/Field/WidgetInterface.php
10 string references to 'Widget'
claro_views_pre_render in core/themes/claro/claro.theme
Implements hook_views_pre_render().
d7_field_instance.yml in core/modules/field/migrations/d7_field_instance.yml
core/modules/field/migrations/d7_field_instance.yml
EntityFormDisplayEditForm::getTableHeader in core/modules/field_ui/src/Form/EntityFormDisplayEditForm.php
Returns an array containing the table headers.
MediaLibraryHooks::viewsPostRender in core/modules/media_library/src/Hook/MediaLibraryHooks.php
Implements hook_views_post_render().
MediaLibraryHooks::viewsPreRender in core/modules/media_library/src/Hook/MediaLibraryHooks.php
Implements hook_views_pre_render().

... See full list

File

core/lib/Drupal/Core/Render/Element/Widget.php, line 23

Namespace

Drupal\Core\Render\Element
View source
class Widget extends Generic {

}

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