public Attribute::hasClass($class)
Checks if the class array has the given CSS class.
string $class: The CSS class to check for.
bool Returns TRUE if the class exists, or FALSE otherwise.
public function hasClass($class) { if (isset($this->storage['class']) && $this->storage['class'] instanceof AttributeArray) { return in_array($class, $this->storage['class']->value()); } else { return FALSE; } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Template!Attribute.php/function/Attribute::hasClass/8.1.x