public function Attribute::__construct

Constructs a \Drupal\Core\Template\Attribute object.

Parameters

array $attributes: An associative array of key-value pairs to be converted to attributes.

File

drupal/core/lib/Drupal/Core/Template/Attribute.php, line 48
Definition of Drupal\Core\Template\Attribute.

Class

Attribute
A class that can be used for collecting then rendering HTML attributtes.

Namespace

Drupal\Core\Template

Code

public function __construct($attributes = array()) {
  foreach ($attributes as $name => $value) {
    $this
      ->offsetSet($name, $value);
  }
}