function public function DrupalAttributes::hasClass

8.x-3.x DrupalAttributes.php public DrupalAttributes::hasClass($class, $type = DrupalAttributes::ATTRIBUTES)

Indicates whether an attributes object has a specific class.

This is a wrapper method to retrieve the correct attributes storage object and then check there if a class exists in the attributes object.

Parameters

string $class: The class to search for.

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

Return value

bool TRUE or FALSE

Class

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

Namespace

Drupal\bootstrap\Utility

Source src/Utility/DrupalAttributes.php (line 239)

public function hasClass($class, $type = DrupalAttributes::ATTRIBUTES) {
  return $this->getAttributes($type)->hasClass($class);
}