A class that defines a type of Attribute that can be added to as an array.
To use with Attribute, the array must be specified. Correct:
$attributes = new Attribute(array());
$attributes['class'] = array();
$attributes['class'][] = 'cat';
Incorrect:
$attributes = new Attribute(array());
$attributes['class'][] = 'cat';
Expanded class hierarchy of AttributeArray
Drupal\Core\Template\Attribute
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AttributeArray:: |
public | function | Implements IteratorAggregate::getIterator(). | |
AttributeArray:: |
public | function | Implements ArrayAccess::offsetExists(). | |
AttributeArray:: |
public | function | Implements ArrayAccess::offsetGet(). | |
AttributeArray:: |
public | function | Implements ArrayAccess::offsetSet(). | |
AttributeArray:: |
public | function | Implements ArrayAccess::offsetUnset(). | |
AttributeArray:: |
public | function | Returns the whole array. | |
AttributeArray:: |
public | function |
Implements the magic __toString() method. Overrides AttributeValueBase:: |
|
AttributeValueBase:: |
protected | property | The name of the value. | |
AttributeValueBase:: |
protected | property | Whether this attribute hsa been printed already. | |
AttributeValueBase:: |
protected | property | The value itself. | |
AttributeValueBase:: |
public | function | Whether this attribute hsa been printed already. | |
AttributeValueBase:: |
public | function | Returns a string representation of the attribute. | 1 |
AttributeValueBase:: |
public | function | Constructs a \Drupal\Core\Template\AttributeValueBase object. |