IdGeneratorTrait
A trait that provides id generating methods to be used in various widget classes.
Table of Contents
Properties
- $_idPrefix : string|null
- Prefix for id attribute.
- $_idSuffixes : array<string|int, string>
- A list of id suffixes used in the current rendering.
Methods
- _clearIds() : void
- Clear the stored ID suffixes.
- _domId() : string
- Generate an ID suitable for use in an ID attribute.
- _id() : string
- Generate an ID attribute for an element.
- _idSuffix() : string
- Generate an ID suffix.
Properties
$_idPrefix
Prefix for id attribute.
protected
string|null
$_idPrefix
$_idSuffixes
A list of id suffixes used in the current rendering.
protected
array<string|int, string>
$_idSuffixes
= []
Methods
_clearIds()
Clear the stored ID suffixes.
protected
_clearIds() : void
_domId()
Generate an ID suitable for use in an ID attribute.
protected
_domId(string $value) : string
Parameters
- $value : string
-
The value to convert into an ID.
Return values
string —The generated id.
_id()
Generate an ID attribute for an element.
protected
_id(string $name, string $val) : string
Ensures that id's for a given set of fields are unique.
Parameters
- $name : string
-
The ID attribute name.
- $val : string
-
The ID attribute value.
Return values
string —Generated id.
_idSuffix()
Generate an ID suffix.
protected
_idSuffix(string $val) : string
Ensures that id's for a given set of fields are unique.
Parameters
- $val : string
-
The ID attribute value.
Return values
string —Generated id suffix.