Skip to content
PHP Ecosystem
Explore

HasElementBuilder

API reference › HTML Core › Element › Concern › HasElementBuilder

traitUIAwesome\Html\Core\Element\Concern\HasElementBuilder
Sourcesrc/Element/Concern/HasElementBuilder.php
Used by 2 types

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.

MethodDescriptionDefined by
buildElement() protectedBuilds element output from content and template tokens.HasElementBuilder
protected function buildElement(string|Stringable $content = '', array $tokenValues = []): string

Builds element output from content and template tokens.

Parameters

ParameterTypeDescription
$contentstring|StringableContent to be rendered inside the tag. Void tags, such as <input>, render no inner content; use attributes such as value instead.
$tokenValuesarrayAdditional token values for template rendering.

Returns

string: Rendered HTML for the element.