public function QueryPath::addClass in QueryPath 6
Same name and namespace in other branches
- 7.3 QueryPath/QueryPath.php \QueryPath::addClass()
- 7.2 QueryPath/QueryPath.php \QueryPath::addClass()
File
- QueryPath/
QueryPath.php, line 1526
Class
Code
public function addClass($class) {
foreach ($this->matches as $m) {
if ($m
->hasAttribute('class')) {
$val = $m
->getAttribute('class');
$m
->setAttribute('class', $val . ' ' . $class);
}
else {
$m
->setAttribute('class', $class);
}
}
return $this;
}