Attribute
class Attribute implements ConfigProvider
Traits
Provides magic get, set, isset and unset implementations
Properties
protected array | $markedSafe | from TemplateSafeness | |
mixed | $defaultValue | Default value used for this attribute |
|
AttributeFilterChain | $filterChain | This attribute's filter chain |
|
bool | $required | Whether this attribute is required for the tag to be valid |
Methods
Return whether this attribute is safe to be used in given context
Return whether this object is safe to be used as a URL
Return whether this object is safe to be used in CSS
Return whether this object is safe to be used in JavaScript
Constructor
Return an array-based representation of this object to be used for parsing
Details
in
Configurable at line 30
mixed
__get(string $propName)
Magic getter
Will return $this->foo if it exists, then $this->getFoo() or will throw an exception if neither exists
in
Configurable at line 61
void
__set(string $propName, mixed $propValue)
Magic setter
Will call $this->setFoo($propValue) if it exists, otherwise it will set $this->foo. If $this->foo is a NormalizedCollection, we do not replace it, instead we clear() it then fill it back up. It will not overwrite an object with a different incompatible object (of a different, non-extending class) and it will throw an exception if the PHP type cannot match without incurring data loss.
in
Configurable at line 147
bool
__isset(string $propName)
Test whether a property is set
in
Configurable at line 164
void
__unset(string $propName)
Unset a property, if the class supports it
at line 66
protected bool
isSafe(string $context)
Return whether this attribute is safe to be used in given context
in
TemplateSafeness at line 34
bool
isSafeAsURL()
Return whether this object is safe to be used as a URL
in
TemplateSafeness at line 44
bool
isSafeInCSS()
Return whether this object is safe to be used in CSS
in
TemplateSafeness at line 54
bool
isSafeInJS()
Return whether this object is safe to be used in JavaScript
in
TemplateSafeness at line 64
TemplateSafeness
markAsSafeAsURL()
Return whether this object is safe to be used as a URL
in
TemplateSafeness at line 76
TemplateSafeness
markAsSafeInCSS()
Return whether this object is safe to be used in CSS
in
TemplateSafeness at line 88
TemplateSafeness
markAsSafeInJS()
Return whether this object is safe to be used in JavaScript
in
TemplateSafeness at line 100
TemplateSafeness
resetSafeness()
Reset the "marked safe" statuses
at line 47
__construct(array|null $options = null)
Constructor
at line 85
array|Dictionary|null
asConfig()
Return an array-based representation of this object to be used for parsing
NOTE: if this method was named getConfig() it could interfere with magic getters from the Configurable trait