You are here

public function DrupalAttributes::setAttributes in Express 8

Sets multiple attributes on an attributes object.

This is a wrapper method to retrieve the correct attributes storage object and then merge multiple attributes into it.

Parameters

array $values: An associative key/value array of attributes to set.

string $type: (optional) The type of attributes to use for this method.

Return value

$this

See also

\Drupal\bootstrap\Utility\Attributes::setAttributes()

1 call to DrupalAttributes::setAttributes()
Variables::map in themes/contrib/bootstrap/src/Utility/Variables.php
Maps an element's properties to the variables attributes array.

File

themes/contrib/bootstrap/src/Utility/DrupalAttributes.php, line 346
Contains \Drupal\bootstrap\Utility\DrupalAttributes.

Class

DrupalAttributes
Class for managing multiple types of attributes commonly found in Drupal.

Namespace

Drupal\bootstrap\Utility

Code

public function setAttributes(array $values, $type = DrupalAttributes::ATTRIBUTES) {
  $this
    ->getAttributes($type)
    ->setAttributes($values);
  return $this;
}