Skip to content
PHP Ecosystem
Explore

HasTemplate

API reference › HTML Mixin › HasTemplate

traitUIAwesome\Html\Mixin\HasTemplate
Sourcesrc/HasTemplate.php
Used by 2 types

Provides an immutable API for managing the template string.

PropertyTypeDescriptionDefined by
$template protectedstringTemplate string used for constructing the HTML tag. Default: ''.HasTemplate
MethodDescriptionDefined by
getTemplate()Returns the template assigned to the element.HasTemplate
template()Sets the template string for the element.HasTemplate
public function getTemplate(): string

Returns the template assigned to the element.

Returns

string: Template value assigned to the element. Never null.

public function template(string $value): static

Sets the template string for the element.

Parameters

ParameterTypeDescription
$valuestringTemplate string to set for the element.

Returns

static: New instance with the updated template value.