Attribute::removeAttribute

public Attribute::removeAttribute() Removes an attribute from an Attribute object. Parameters string|array ...: Attributes to remove from the attribute array. Return value $this File core/lib/Drupal/Core/Template/Attribute.php, line 219 Class Attribute Collects, sanitizes, and renders HTML attributes. Namespace Drupal\Core\Template Code public function removeAttribute() { $args = func_get_args(); foreach ($args as $arg) { // Support arrays or multiple arguments. if (is_ar

Attribute::offsetUnset

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

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::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::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::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::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::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::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