WidgetBase::extractFormValues

public WidgetBase::extractFormValues(FieldItemListInterface $items, array $form, FormStateInterface $form_state) Extracts field values from submitted form values. Parameters \Drupal\Core\Field\FieldItemListInterface $items: The field values. This parameter is altered by reference to receive the incoming form values. array $form: The form structure where field elements are attached to. This might be a full form structure, or a sub-element of a larger form. \Drupal\Core\Form\FormStateInterface $

WidgetBase::$fieldDefinition

The field definition. Type: \Drupal\Core\Field\FieldDefinitionInterface File core/lib/Drupal/Core/Field/WidgetBase.php, line 27 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code protected $fieldDefinition;

WidgetBase::addMoreAjax

public static WidgetBase::addMoreAjax(array $form, FormStateInterface $form_state) Ajax callback for the "Add another item" button. This returns the new page content to replace the page content made obsolete by the form submission. File core/lib/Drupal/Core/Field/WidgetBase.php, line 291 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code public static function addMoreAjax(array $form, FormStateInterface $form_state) { $button = $fo

WidgetBase::addMoreSubmit

public static WidgetBase::addMoreSubmit(array $form, FormStateInterface $form_state) Submission handler for the "Add another item" button. File core/lib/Drupal/Core/Field/WidgetBase.php, line 269 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code public static function addMoreSubmit(array $form, FormStateInterface $form_state) { $button = $form_state->getTriggeringElement(); // Go one level up in the form, to the widgets cont

WidgetBase::afterBuild

public static WidgetBase::afterBuild(array $element, FormStateInterface $form_state) After-build handler for field elements in a form. This stores the final location of the field within the form structure so that flagErrors() can assign validation errors to the right form element. File core/lib/Drupal/Core/Field/WidgetBase.php, line 255 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code public static function afterBuild(array $elemen

WidgetBase::errorElement

public WidgetBase::errorElement(array $element, ConstraintViolationInterface $error, array $form, FormStateInterface $form_state) Assigns a field-level validation error to the right widget sub-element. Depending on the widget's internal structure, a field-level validation error needs to be flagged on the right sub-element. Parameters array $element: An array containing the form element for the widget, as generated by formElement(). \Symfony\Component\Validator\ConstraintViolationInterface $vio

WidgetBase::$settings

The widget settings. Type: array Overrides PluginSettingsBase::$settings File core/lib/Drupal/Core/Field/WidgetBase.php, line 34 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code protected $settings;

WidgetBase

Base class for 'Field widget' plugin implementations. Hierarchy class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterfaceclass \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, StringTranslationTraitclass \Drupal\Core\Field\PluginSettingsBase implements DependentPluginInterface, PluginSettingsInterfaceclass \Drupal\Core\Field\WidgetBase implements WidgetInterface uses AllowedTagsXssTrait Related topics Field Widget API De

Weight::getInfo

public Weight::getInfo() Returns the element properties for this element. Return value array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format. Overrides ElementInterface::getInfo File core/lib/Drupal/Core/Render/Element/Weight.php, line 34 Class Weight Provides a form element for input of a weight. Namespace Drupal\Core\Render\Element Code public func

Weight::processWeight

public static Weight::processWeight(&$element, FormStateInterface $form_state, &$complete_form) Expands a weight element into a select element. File core/lib/Drupal/Core/Render/Element/Weight.php, line 50 Class Weight Provides a form element for input of a weight. Namespace Drupal\Core\Render\Element Code public static function processWeight(&$element, FormStateInterface $form_state, &$complete_form) { $element['#is_weight'] = TRUE; $element_info_manager = \Drupal: