You are here

public function QueryPath::hasClass in QueryPath 6

Same name and namespace in other branches
  1. 7.3 QueryPath/QueryPath.php \QueryPath::hasClass()
  2. 7.2 QueryPath/QueryPath.php \QueryPath::hasClass()

File

QueryPath/QueryPath.php, line 1558

Class

QueryPath

Code

public function hasClass($class) {
  foreach ($this->matches as $m) {
    if ($m
      ->hasAttribute('class')) {
      $vals = explode(' ', $m
        ->getAttribute('class'));
      if (in_array($class, $vals)) {
        return TRUE;
      }
    }
  }
  return FALSE;
}