Attribute::removeClass

public Attribute::removeClass() Removes argument values from array of existing CSS classes. Parameters string|array ...: CSS classes to remove from the class attribute array. Return value $this File core/lib/Drupal/Core/Template/Attribute.php, line 244 Class Attribute Collects, sanitizes, and renders HTML attributes. Namespace Drupal\Core\Template Code public function removeClass() { // With no class attribute, there is no need to remove. if (isset($this->storage['class']) &am

Attribute::offsetSet

public Attribute::offsetSet($name, $value) File core/lib/Drupal/Core/Template/Attribute.php, line 98 Class Attribute Collects, sanitizes, and renders HTML attributes. Namespace Drupal\Core\Template Code public function offsetSet($name, $value) { $this->storage[$name] = $this->createAttributeValue($name, $value); }

Attribute::setAttribute

public Attribute::setAttribute($attribute, $value) Sets values for an attribute key. Parameters string $attribute: Name of the attribute. string|array $value: Value(s) to set for the given attribute key. Return value $this File core/lib/Drupal/Core/Template/Attribute.php, line 205 Class Attribute Collects, sanitizes, and renders HTML attributes. Namespace Drupal\Core\Template Code public function setAttribute($attribute, $value) { $this->offsetSet($attribute, $value); return

Attribute::getIterator

public Attribute::getIterator() File core/lib/Drupal/Core/Template/Attribute.php, line 324 Class Attribute Collects, sanitizes, and renders HTML attributes. Namespace Drupal\Core\Template Code public function getIterator() { return new \ArrayIterator($this->storage); }

Attribute::offsetGet

public Attribute::offsetGet($name) File core/lib/Drupal/Core/Template/Attribute.php, line 89 Class Attribute Collects, sanitizes, and renders HTML attributes. Namespace Drupal\Core\Template Code public function offsetGet($name) { if (isset($this->storage[$name])) { return $this->storage[$name]; } }

Attribute::offsetExists

public Attribute::offsetExists($name) File core/lib/Drupal/Core/Template/Attribute.php, line 158 Class Attribute Collects, sanitizes, and renders HTML attributes. Namespace Drupal\Core\Template Code public function offsetExists($name) { return isset($this->storage[$name]); }

Attribute::hasClass

public Attribute::hasClass($class) Checks if the class array has the given CSS class. Parameters string $class: The CSS class to check for. Return value bool Returns TRUE if the class exists, or FALSE otherwise. File core/lib/Drupal/Core/Template/Attribute.php, line 273 Class Attribute Collects, sanitizes, and renders HTML attributes. Namespace Drupal\Core\Template Code public function hasClass($class) { if (isset($this->storage['class']) && $this->storage['class'] in

Attribute::createAttributeValue

protected Attribute::createAttributeValue($name, $value) Creates the different types of attribute values. Parameters string $name: The attribute name. mixed $value: The attribute value. Return value \Drupal\Core\Template\AttributeValueBase An AttributeValueBase representation of the attribute's value. File core/lib/Drupal/Core/Template/Attribute.php, line 113 Class Attribute Collects, sanitizes, and renders HTML attributes. Namespace Drupal\Core\Template Code protected function creat

Attribute::jsonSerialize

public Attribute::jsonSerialize() Returns a representation of the object for use in JSON serialization. Return value string The safe string content. File core/lib/Drupal/Core/Template/Attribute.php, line 341 Class Attribute Collects, sanitizes, and renders HTML attributes. Namespace Drupal\Core\Template Code public function jsonSerialize() { return (string) $this; }

Attribute::addClass

public Attribute::addClass() Adds classes or merges them on to array of existing CSS classes. Parameters string|array ...: CSS classes to add to the class attribute array. Return value $this File core/lib/Drupal/Core/Template/Attribute.php, line 170 Class Attribute Collects, sanitizes, and renders HTML attributes. Namespace Drupal\Core\Template Code public function addClass() { $args = func_get_args(); if ($args) { $classes = array(); foreach ($args as $arg) { // Me