ElementInterface
interface ElementInterface implements PluginInspectionInterface, RenderCallbackInterface (View source)
Provides an interface for render element plugins.
Render element plugins allow modules to declare their own Render API element types and specify the default values for the properties. The values returned by the getInfo() method of the element plugin will be merged with the properties specified in render arrays. Thus, you can specify defaults for any Render API keys, in addition to those explicitly documented by \Drupal\Core\Render\ElementInfoManagerInterface::getInfo().
Some render elements are specifically form input elements; see \Drupal\Core\Render\Element\FormElementInterface for more information.
The public API of these objects must be designed with security in mind as render elements process raw user input.
Methods
Gets the definition of the plugin implementation.
Returns the element properties for this element.
Sets a form element's class attribute.
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.