You are here

public static function ElementInterface::setAttributes in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Render/Element/ElementInterface.php \Drupal\Core\Render\Element\ElementInterface::setAttributes()

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.

1 method overrides ElementInterface::setAttributes()
RenderElement::setAttributes in core/lib/Drupal/Core/Render/Element/RenderElement.php
Sets a form element's class attribute.

File

core/lib/Drupal/Core/Render/Element/ElementInterface.php, line 55
Contains \Drupal\Core\Render\Element\ElementInterface.

Class

ElementInterface
Provides an interface for render element plugins.

Namespace

Drupal\Core\Render\Element

Code

public static function setAttributes(&$element, $class = array());