HasElementBuilder
API reference › HTML Core › Element › Concern › HasElementBuilder
Provides template-driven composition of the prefix, tag, and suffix segments of an element.
Each segment is rendered with the renderer matching its tag kind, and the {prefix}, {tag}, and {suffix} tokens
are then replaced in the configured template.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
buildElement() protected | Builds element output from content and template tokens. | HasElementBuilder |
Method details
Section titled “Method details”buildElement()
Section titled “buildElement() ”protected function buildElement(string|Stringable $content = '', array $tokenValues = []): stringBuilds element output from content and template tokens.
Parameters
| Parameter | Type | Description |
|---|---|---|
$content | string|Stringable | Content to be rendered inside the tag. Void tags, such as <input>, render no inner content; use attributes such as value instead. |
$tokenValues | array | Additional token values for template rendering. |
Returns
string: Rendered HTML for the element.