Skip to main content

OriginalHtmlAttributesSet

Exact copy of \Laminas\View\HtmlAttributesSet final class, in order to allow extending it.

Class for storing and processing HTML tag attributes.


  • Full name: \TwbsHelper\View\OriginalHtmlAttributesSet
  • Parent class: ArrayObject
  • This class implements: Stringable

Properties​

escaper​

HTML escaper

private \Laminas\Escaper\Escaper $escaper

Methods​

__construct​

public __construct(\Laminas\Escaper\Escaper $escaper, iterable $attributes = []): mixed

Parameters:

ParameterTypeDescription
$escaper\Laminas\Escaper\Escaper
$attributesiterable

set​

Set several attributes at once.

public set(\TwbsHelper\View\AttributeSet $attributes): self

Parameters:

ParameterTypeDescription
$attributes\TwbsHelper\View\AttributeSet

add​

Add a value to an attribute.

public add(string $name, scalar|array|null $value): self

Sets the attribute if it does not exist.

Parameters:

ParameterTypeDescription
$namestring
$valuescalar|array|null

merge​

Merge attributes with existing attributes.

public merge(\TwbsHelper\View\AttributeSet $attributes): self

Parameters:

ParameterTypeDescription
$attributes\TwbsHelper\View\AttributeSet

hasValue​

Whether the named attribute equals or contains the given value

public hasValue(string $name, scalar|array|null $value): bool

Parameters:

ParameterTypeDescription
$namestring
$valuescalar|array|null

__toString​

Return a string of tag attributes.

public __toString(): string