ButtonAttributes implements ArrayAccess, IteratorAggregate, Countable, Arrayable
FinalYes
Table of Contents
Interfaces
- ArrayAccess
- IteratorAggregate
- Countable
- Arrayable
Constants
- JSON_OPTIONS_DATA_ATTR = 'data-json-options'
Methods
- __construct() : mixed
- __toString() : string
- addClass() : $this
- addDataAttribute() : $this
- addJsonOption() : mixed
- count() : int
- Count elements of an object
- getAttribute() : mixed|null
- getDataAttribute() : mixed|null
- getDataAttributes() : array<string|int, mixed>
- getIterator() : Traversable
- Retrieve an external iterator
- getJsonOptions() : mixed
- hasClass() : bool
- offsetExists() : bool
- Whether a offset exists
- offsetGet() : mixed
- Offset to retrieve
- offsetSet() : void
- Offset to set
- offsetUnset() : void
- Offset to unset
- removeClass() : $this
- removeJsonOption() : mixed
- setAttributes() : mixed
- setClassList() : mixed
- setJsonOptions() : mixed
- toArray() : array<string|int, mixed>
- toString() : string
Constants
JSON_OPTIONS_DATA_ATTR
public
mixed
JSON_OPTIONS_DATA_ATTR
= 'data-json-options'
Methods
__construct()
public
__construct([array<string|int, mixed> $attributes = [] ]) : mixed
Parameters
- $attributes : array<string|int, mixed> = []
__toString()
public
__toString() : string
Return values
stringaddClass()
public
addClass(string $className) : $this
Parameters
- $className : string
Return values
$thisaddDataAttribute()
public
addDataAttribute(string $name[, mixed|null $value = null ]) : $this
Parameters
- $name : string
- $value : mixed|null = null
Return values
$thisaddJsonOption()
public
addJsonOption(mixed $key, mixed $value) : mixed
Parameters
- $key : mixed
- $value : mixed
count()
Count elements of an object
public
count() : int
Tags
Return values
int —The custom count as an integer.
The return value is cast to an integer.
getAttribute()
public
getAttribute(string $name[, mixed|null $defaultValue = null ]) : mixed|null
Parameters
- $name : string
- $defaultValue : mixed|null = null
Return values
mixed|nullgetDataAttribute()
public
getDataAttribute(string $name[, mixed|null $defaultValue = null ]) : mixed|null
Parameters
- $name : string
- $defaultValue : mixed|null = null
Return values
mixed|nullgetDataAttributes()
public
getDataAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getIterator()
Retrieve an external iterator
public
getIterator() : Traversable
Tags
Return values
Traversable —An instance of an object implementing Iterator or Traversable
getJsonOptions()
public
getJsonOptions() : mixed
hasClass()
public
hasClass(string $className) : bool
Parameters
- $className : string
Return values
booloffsetExists()
Whether a offset exists
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
-
An offset to check for.
Tags
Return values
bool —true on success or false on failure.
The return value will be casted to boolean if non-boolean was returned.
offsetGet()
Offset to retrieve
public
& offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
-
The offset to retrieve.
Tags
Return values
mixed —Can return all value types.
offsetSet()
Offset to set
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
-
The offset to assign the value to.
- $value : mixed
-
The value to set.
Tags
offsetUnset()
Offset to unset
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
-
The offset to unset.
Tags
removeClass()
public
removeClass(string $className) : $this
Parameters
- $className : string
Return values
$thisremoveJsonOption()
public
removeJsonOption(mixed $key) : mixed
Parameters
- $key : mixed
setAttributes()
public
setAttributes(array<string|int, mixed> $attributes) : mixed
Parameters
- $attributes : array<string|int, mixed>
setClassList()
public
setClassList(array<string|int, mixed> $classList) : mixed
Parameters
- $classList : array<string|int, mixed>
setJsonOptions()
public
setJsonOptions(array<string|int, mixed> $options) : mixed
Parameters
- $options : array<string|int, mixed>
toArray()
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toString()
public
toString() : string