Drupal 8  8.0.2
ElementInterface Interface Reference
Inheritance diagram for ElementInterface:

Public Member Functions

 getInfo ()
 
- Public Member Functions inherited from PluginInspectionInterface
 getPluginId ()
 
 getPluginDefinition ()
 

Static Public Member Functions

static setAttributes (&$element, $class=array())
 

Detailed Description

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 ::getInfo().

Some render elements are specifically form input elements; see for more information.

See Also
Plugin API

Member Function Documentation

static setAttributes ( $element,
  $class = array() 
)
static

Sets a form element's class attribute.

Adds 'required' and 'error' classes as needed.

Parameters
array$elementThe form element.
array$classArray of new class names to be added.

Implemented in RenderElement.


The documentation for this interface was generated from the following file: