You are here

function _bootstrap_get_attributes in Express 8

Retrieves an element's "attributes" array.

// Before.
$attributes =& _bootstrap_get_attributes($element);
$attributes['class'][] = 'my-class';

// After.
use Drupal\bootstrap\Utility\Element;
$attributes =& Element::create($element)
  ->getAttributes();
$attributes['class'][] = 'my-class';

Parameters

array $element: The individual renderable array element, passed by reference.

string $property: Determines which attributes array to retrieve. By default, this is the element's normal "attributes", but it could also be one of the following:

  • "content_attributes"
  • "input_group_attributes"
  • "title_attributes"
  • "wrapper_attributes".

Return value

array The attributes array.

Deprecated

Will be removed in a future release.

See also

\Drupal\bootstrap\Utility\Element::getAttributes()

File

themes/contrib/bootstrap/deprecated.php, line 263
This contains deprecated functions that will be removed in a future release.

Code

function &_bootstrap_get_attributes(array &$element, $property = 'attributes') {
  Bootstrap::deprecated();
  return Element::create($element)
    ->getAttributes($property);
}