You are here

public function Attributes::hasClass in Express 8

Indicates whether a class is present in the array.

Parameters

string|array $class: The class or array of classes to search for.

bool $all: Flag determining to check if all classes are present.

Return value

bool TRUE or FALSE

See also

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

File

themes/contrib/bootstrap/src/Utility/Attributes.php, line 95
Contains \Drupal\bootstrap\Utility\Attributes.

Class

Attributes
Class to help modify attributes.

Namespace

Drupal\bootstrap\Utility

Code

public function hasClass($class, $all = FALSE) {
  $classes = (array) $class;
  $result = array_intersect($classes, $this
    ->getClasses());
  return $all ? $result && count($classes) === count($result) : !!$result;
}