FormElementInterface
interface FormElementInterface implements ElementInterface (View source)
Provides an interface for form element plugins.
Form element plugins are a subset of render elements, specifically representing HTML elements that take input as part of a form. Form element plugins are discovered via the same mechanism as regular render element plugins. See \Drupal\Core\Render\Element\ElementInterface for general information about render element plugins.
Methods
Gets the definition of the plugin implementation.
Sets a form element's class attribute.
Determines how user input is mapped to an element's #value property.
Details
string
getPluginId()
Gets the plugin_id of the plugin instance.
array
getPluginDefinition()
Gets the definition of the plugin implementation.
array
getInfo()
Returns the element properties for this element.
static
setAttributes(array $element, array $class = [])
Sets a form element's class attribute.
Adds 'required' and 'error' classes as needed.
static mixed
valueCallback(array $element, mixed $input, FormStateInterface $form_state)
Determines how user input is mapped to an element's #value property.