HTML::offsetSet()
Sets the attribute’s value.
Table of Contents
Description
HTML::offsetSet(mixed $key, mixed $value): void;This method is a requirement to be able to implement the ArrayAccess interface and aims to make the object data modifiable using array access syntax. You won’t use this method directly, it will be executed automatically when you try to set an attribute’s value with array access syntax.
Example
$node = new HTML('<a name="test"></a>');
$node[0] = 'input';
echo $node; // Returns `'<input name="test"></input>'`
$node[1] = false;
echo $node; // Returns `'<input name="test">'`
$node['disabled'] = true;
$node['type'] = 'text';
$node['value'] = 'aaa"bbb';
echo $node; // Returns `'<input disabled name="test" type="text" value="aaa"bbb">'`HTML::_()
The dynamic method initiator.
HTML::__call()
Proxy for missing methods.
HTML::__callStatic()
Proxy for missing static methods.
HTML::__construct()
The constructor.
HTML::__serialize()
Provides data to be serialized.
HTML::__toString()
Converts the HTML object to string.
HTML::__unserialize()
Converts the serialized data back to its object.
HTML::count()
Nothing.
HTML::jsonSerialize()
Returns the data to be serialized as JSON.
HTML::offsetExists()
Checks if an attribute exists.
HTML::offsetGet()
Gets the attribute’s value.
HTML::offsetSet()
Sets the attribute’s value.
HTML::offsetUnset()
Deletes an attribute.