ElementInterface::setAttributes

public static ElementInterface::setAttributes(&$element, $class = array())

Sets a form element's class attribute.

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

Parameters

array $element: The form element.

array $class: Array of new class names to be added.

File

core/lib/Drupal/Core/Render/Element/ElementInterface.php, line 50

Class

ElementInterface
Provides an interface for render element plugins.

Namespace

Drupal\Core\Render\Element

Code

public static function setAttributes(&$element, $class = array());
doc_Drupal
2016-10-29 09:04:06
Comments
Leave a Comment

Please login to continue.