function _bootstrap_get_classes

8 deprecated.php &_bootstrap_get_classes(array &$element, $property = 'attributes')
7 common.inc &_bootstrap_get_classes(&$element, $property = 'attributes')

Retrieves an element's "class" attribute array.

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

  // After.
  use Drupal\bootstrap\Utility\Element;
  $classes = &Element::create($element)->getClasses();
  $classes[] = '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 classes array.

Deprecated

Will be removed in a future release. There is no replacement.

See Also

  • \Drupal\bootstrap\Utility\Element::getClasses()

Source ./deprecated.php (line 343)

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