AttributeBag
in package
Defines a list of attributes for a html element.
Table of Contents
- $attributes : array<string|int, mixed>
- __construct() : mixed
- __toString() : mixed
- add() : AttributeBag
- Add an attribute. First argument can be an array of attributes
- get() : array<string|int, mixed>
- Get all attributes
- has() : bool
- Does an attribute exist
- remove() : AttributeBag
- Removes an argument
- size() : int
- Get amount of attributes
- toHtml() : string
- Get html string for all arguments
Properties
$attributes
protected
array<string|int, mixed>
$attributes
= []
Methods
__construct()
public
__construct([array<string|int, mixed> $attributes = [] ]) : mixed
Parameters
- $attributes : array<string|int, mixed> = []
Tags
Return values
mixed —__toString()
public
__toString() : mixed
Tags
Return values
mixed —add()
Add an attribute. First argument can be an array of attributes
public
add(array<string|int, mixed>|string $index[, mixed $value = null ]) : AttributeBag
Parameters
- $index : array<string|int, mixed>|string
- $value : mixed = null
Return values
AttributeBag —get()
Get all attributes
public
get() : array<string|int, mixed>
Return values
array<string|int, mixed> —has()
Does an attribute exist
public
has(string $index) : bool
Parameters
- $index : string
Return values
bool —remove()
Removes an argument
public
remove(string $index) : AttributeBag
Parameters
- $index : string
Return values
AttributeBag —size()
Get amount of attributes
public
size() : int
Return values
int —toHtml()
Get html string for all arguments
public
toHtml() : string