3 namespace Drupal\Core\Render\Element;
5 use Drupal\Core\Form\FormStateInterface;
8 * Provides an interface for form element plugins.
10 * Form element plugins are a subset of render elements, specifically
11 * representing HTML elements that take input as part of a form. Form element
12 * plugins are discovered via the same mechanism as regular render element
13 * plugins. See \Drupal\Core\Render\Element\ElementInterface for general
14 * information about render element plugins.
16 * @see \Drupal\Core\Render\ElementInfoManager
17 * @see \Drupal\Core\Render\Element\FormElement
18 * @see \Drupal\Core\Render\Annotation\FormElement
21 * @ingroup theme_render
23 interface FormElementInterface extends ElementInterface {
26 * Determines how user input is mapped to an element's #value property.
28 * @param array $element
29 * An associative array containing the properties of the element.
31 * The incoming input to populate the form element. If this is FALSE,
32 * the element's default value should be returned.
33 * @param \Drupal\Core\Form\FormStateInterface $form_state
34 * The current state of the form.
37 * The value to assign to the element.
39 public static function valueCallback(&$element, $input, FormStateInterface $form_state);