HasTemplate
API reference › HTML Mixin › HasTemplate
Provides an immutable API for managing the template string.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$template protected | string | Template string used for constructing the HTML tag. Default: ''. | HasTemplate |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
getTemplate() | Returns the template assigned to the element. | HasTemplate |
template() | Sets the template string for the element. | HasTemplate |
Method details
Section titled “Method details”getTemplate()
Section titled “getTemplate() ”public function getTemplate(): stringReturns the template assigned to the element.
Returns
string: Template value assigned to the element. Never null.
template()
Section titled “template() ”public function template(string $value): staticSets the template string for the element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string | Template string to set for the element. |
Returns
static: New instance with the updated template value.