abstract class AbstractTag implements TagInterface (View source)

Provides immutable attribute-based metadata tags while escaping their name and content.

Custom subclasses must remain readonly to preserve the tag's fixed key and content.

Traits

Methods

__construct(string $key, string|null $content)

Initializes the tag's attribute value and optional content.

string
string
string
render()

Renders the concrete tag template or suppresses it for empty content.

string

Details

__construct

__construct(string $key, string|null $content)

Initializes the tag's attribute value and optional content.

Parameters

string $key
string|null $content

template

abstract protected string template()

No description

Return Value

string

render

string render()

Renders the concrete tag template or suppresses it for empty content.

Return Value

string