public static ElementInterface::setAttributes(&$element, $class = array())
Sets a form element's class attribute.
Adds 'required' and 'error' classes as needed.
array $element: The form element.
array $class: Array of new class names to be added.
public static function setAttributes(&$element, $class = array());
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Element!ElementInterface.php/function/ElementInterface::setAttributes/8.1.x