HasSuffixCollection
API reference › HTML Mixin › HasSuffixCollection
Provides an immutable API for managing suffix element and its attributes.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$suffix protected | string | Suffix content string assigned to the element. Default: ''. | HasSuffixCollection |
$suffixAttributes protected | array | HTML attributes array for the suffix element. Default: []. | HasSuffixCollection |
$suffixTag protected | false|UnitEnum | Tag name for the suffix element, or false to disable. Default: false. | HasSuffixCollection |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
getSuffix() | Returns the suffix content string assigned to the element. | HasSuffixCollection |
getSuffixAttribute() | Returns the value of a single HTML attribute for the suffix element attributes. | HasSuffixCollection |
getSuffixAttributes() | Returns the array of HTML attributes for the suffix element. | HasSuffixCollection |
getSuffixTag() | Returns the tag name for the suffix element. | HasSuffixCollection |
suffix() | Sets the suffix content string for the element. | HasSuffixCollection |
suffixAttributes() | Sets the HTML attributes for the suffix element. | HasSuffixCollection |
suffixClass() | Adds a CSS class to the suffix element attributes. | HasSuffixCollection |
suffixRemoveAttribute() | Removes a specific HTML attribute from the suffix element. | HasSuffixCollection |
suffixSetAttribute() | Sets a single HTML attribute for the suffix element. | HasSuffixCollection |
suffixTag() | Sets the tag type for the suffix element. | HasSuffixCollection |
Method details
Section titled “Method details”getSuffix()
Section titled “getSuffix() ”public function getSuffix(): stringReturns the suffix content string assigned to the element.
Returns
string: Suffix content string assigned to the element.
getSuffixAttribute()
Section titled “getSuffixAttribute() ”public function getSuffixAttribute(string|UnitEnum $key, mixed $default = null, string $prefix = ''): mixedReturns the value of a single HTML attribute for the suffix element attributes.
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string|UnitEnum | Attribute name. |
$default | mixed | Default value when the attribute is missing. |
$prefix | string | Prefix to ensure (for example, aria-, data-, on). |
Returns
mixed: Attribute value or default.
getSuffixAttributes()
Section titled “getSuffixAttributes() ”public function getSuffixAttributes(): arrayReturns the array of HTML attributes for the suffix element.
Returns
array: Attributes array assigned to the suffix element.
getSuffixTag()
Section titled “getSuffixTag() ”public function getSuffixTag(): false|UnitEnumReturns the tag name for the suffix element.
Returns
false|UnitEnum: Tag name for the suffix element, or false to disable.
suffix()
Section titled “suffix() ”public function suffix(string|Stringable ...$values): staticSets the suffix content string for the element.
Parameters
| Parameter | Type | Description |
|---|---|---|
...$values | string|Stringable | Suffix content to set for the element. |
Returns
static: New instance with the updated suffix value.
suffixAttributes()
Section titled “suffixAttributes() ”public function suffixAttributes(array $values, string $prefix = ''): staticSets the HTML attributes for the suffix element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$values | array | Associative array of attribute keys and values. |
$prefix | string | Prefix to ensure (for example, aria-, data-, on). |
Returns
static: New instance with the updated suffixAttributes value.
suffixClass()
Section titled “suffixClass() ”public function suffixClass(string|Stringable|UnitEnum|null $value, bool $override = false): staticAdds a CSS class to the suffix element attributes.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | CSS class name to add. |
$override | bool | Whether to override existing class value. |
Returns
static: New instance with the updated suffixAttributes value.
suffixRemoveAttribute()
Section titled “suffixRemoveAttribute() ”public function suffixRemoveAttribute(string|UnitEnum $key, string $prefix = ''): staticRemoves a specific HTML attribute from the suffix element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string|UnitEnum | Attribute name to remove. |
$prefix | string | Prefix to ensure (for example, aria-, data-, on). |
Returns
static: New instance without the specified suffix attribute.
suffixSetAttribute()
Section titled “suffixSetAttribute() ”public function suffixSetAttribute(string|UnitEnum $key, mixed $value, string $prefix = ''): staticSets a single HTML attribute for the suffix element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string|UnitEnum | Attribute name. |
$value | mixed | Attribute value. |
$prefix | string | Prefix to ensure (for example, aria-, data-, on). |
Returns
static: New instance with the updated suffixAttributes value.
suffixTag()
Section titled “suffixTag() ”public function suffixTag(false|UnitEnum $value = false): staticSets the tag type for the suffix element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | false|UnitEnum | Tag name for the suffix element, or false to disable. |
Returns
static: New instance with the updated suffixTag value.