You are here

public function DrupalAttributes::getAttribute in Express 8

Retrieve a specific attribute from an attributes object.

This is a wrapper method to retrieve the correct attributes storage object and then retrieve the attribute from it.

Parameters

string $name: The specific attribute to retrieve.

mixed $default: (optional) The default value to set if the attribute does not exist.

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

Return value

mixed A specific attribute value, passed by reference.

See also

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

File

themes/contrib/bootstrap/src/Utility/DrupalAttributes.php, line 165
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 &getAttribute($name, $default = NULL, $type = DrupalAttributes::ATTRIBUTES) {
  return $this
    ->getAttributes($type)
    ->getAttribute($name, $default);
}