Skip to content
PHP Ecosystem
Explore

InputText

API reference › HTML › Form › InputText

final classUIAwesome\Html\Form\InputText
ExtendsUIAwesome\Html\Core\Element\BaseInput » UIAwesome\Html\Core\Base\BaseTag
ImplementsUIAwesome\Html\Contracts\Form\PlaceholderInterface, UIAwesome\Html\Contracts\Attribute\ValueInterface, UIAwesome\Html\Contracts\Form\FormControlInterface, UIAwesome\Html\Contracts\RenderableInterface
Uses traitsUIAwesome\Html\Attribute\Global\CanBeAutofocus, UIAwesome\Html\Form\Mixin\HasMaxlength, UIAwesome\Html\Form\Mixin\HasMinlength, UIAwesome\Html\Form\Mixin\HasPattern, UIAwesome\Html\Form\Mixin\HasPlaceholder, UIAwesome\Html\Form\Mixin\HasSize, UIAwesome\Html\Attribute\Global\HasSpellcheck, UIAwesome\Html\Attribute\Global\HasTabindex, UIAwesome\Html\Attribute\HasValue, UIAwesome\Html\Attribute\CanBeDisabled, UIAwesome\Html\Attribute\Global\CanBeHidden, UIAwesome\Html\Attribute\Global\HasAccesskey, UIAwesome\Html\Attribute\Global\HasAria, UIAwesome\Html\Mixin\HasAttributes, UIAwesome\Html\Attribute\Global\HasClass, UIAwesome\Html\Attribute\Global\HasData, UIAwesome\Html\Attribute\Global\HasDir, UIAwesome\Html\Core\Element\Concern\HasElementBuilder, UIAwesome\Html\Attribute\Global\HasEvents, UIAwesome\Html\Attribute\Global\HasId, UIAwesome\Html\Attribute\Global\HasLang, UIAwesome\Html\Attribute\HasName, UIAwesome\Html\Mixin\HasPrefixCollection, UIAwesome\Html\Attribute\Global\HasRole, UIAwesome\Html\Attribute\Global\HasStyle, UIAwesome\Html\Mixin\HasSuffixCollection, UIAwesome\Html\Mixin\HasTemplate, UIAwesome\Html\Attribute\Global\HasTitle, UIAwesome\Html\Attribute\Global\HasTranslate, UIAwesome\Html\Attribute\HasType, UIAwesome\Html\Core\Event\HasAfterRun, UIAwesome\Html\Core\Event\HasBeforeRun
Sourcesrc/Form/InputText.php

Renders the HTML <input type="text"> element.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/text.

PropertyTypeDescriptionDefined by
$attributes protectedmixed[]HTML attributes array used by the implementing class. Default: [].UIAwesome\Html\Mixin\HasAttributes
$prefix protectedstringPrefix content string assigned to the element. Default: ''.UIAwesome\Html\Mixin\HasPrefixCollection
$prefixAttributes protectedarrayHTML attributes array for the prefix element. Default: [].UIAwesome\Html\Mixin\HasPrefixCollection
$prefixTag protectedfalse|UnitEnumTag name for the prefix element, or false to disable. Default: false.UIAwesome\Html\Mixin\HasPrefixCollection
$suffix protectedstringSuffix content string assigned to the element. Default: ''.UIAwesome\Html\Mixin\HasSuffixCollection
$suffixAttributes protectedarrayHTML attributes array for the suffix element. Default: [].UIAwesome\Html\Mixin\HasSuffixCollection
$suffixTag protectedfalse|UnitEnumTag name for the suffix element, or false to disable. Default: false.UIAwesome\Html\Mixin\HasSuffixCollection
$template protectedstringTemplate string used for constructing the HTML tag. Default: ''.UIAwesome\Html\Mixin\HasTemplate
MethodDescriptionDefined by
__construct() finalInitializes a new tag instance.UIAwesome\Html\Core\Base\BaseTag
__toString()Returns the rendered tag string.UIAwesome\Html\Core\Base\BaseTag
accesskey()Sets the accesskey attribute.UIAwesome\Html\Attribute\Global\HasAccesskey
addAriaAttribute()Sets an aria-* attribute.UIAwesome\Html\Attribute\Global\HasAria
addAttribute()Adds or updates a single HTML attribute for the element.UIAwesome\Html\Mixin\HasAttributes
addDataAttribute()Sets a data-* attribute.UIAwesome\Html\Attribute\Global\HasData
addEvent()Sets an on* event attribute.UIAwesome\Html\Attribute\Global\HasEvents
ariaAttributes()Sets multiple aria-* attributes.UIAwesome\Html\Attribute\Global\HasAria
attributes()Adds or updates multiple HTML attributes for the element.UIAwesome\Html\Mixin\HasAttributes
autocomplete()Sets the autocomplete attribute.InputText
autofocus()Sets the autofocus attribute.UIAwesome\Html\Attribute\Global\CanBeAutofocus
class()Sets the class attribute.UIAwesome\Html\Attribute\Global\HasClass
config()Applies application-scoped config recipes to this tag.UIAwesome\Html\Core\Base\BaseTag
dataAttributes()Sets multiple data-* attributes.UIAwesome\Html\Attribute\Global\HasData
dir()Sets the dir attribute.UIAwesome\Html\Attribute\Global\HasDir
dirname()Sets the dirname attribute.InputText
disabled()Sets the disabled attribute.UIAwesome\Html\Attribute\CanBeDisabled
events()Sets multiple on* event attributes.UIAwesome\Html\Attribute\Global\HasEvents
form()Sets the form attribute.UIAwesome\Html\Core\Element\BaseInput
getAttribute()Returns the value of a single HTML attribute.UIAwesome\Html\Mixin\HasAttributes
getAttributes()Returns the array of HTML attributes for the element.UIAwesome\Html\Mixin\HasAttributes
getPrefix()Returns the prefix content string assigned to the element.UIAwesome\Html\Mixin\HasPrefixCollection
getPrefixAttribute()Returns the value of a single HTML attribute for the prefix element attributes.UIAwesome\Html\Mixin\HasPrefixCollection
getPrefixAttributes()Returns the array of HTML attributes for the prefix element.UIAwesome\Html\Mixin\HasPrefixCollection
getPrefixTag()Returns the tag name for the prefix element.UIAwesome\Html\Mixin\HasPrefixCollection
getSuffix()Returns the suffix content string assigned to the element.UIAwesome\Html\Mixin\HasSuffixCollection
getSuffixAttribute()Returns the value of a single HTML attribute for the suffix element attributes.UIAwesome\Html\Mixin\HasSuffixCollection
getSuffixAttributes()Returns the array of HTML attributes for the suffix element.UIAwesome\Html\Mixin\HasSuffixCollection
getSuffixTag()Returns the tag name for the suffix element.UIAwesome\Html\Mixin\HasSuffixCollection
getTemplate()Returns the template assigned to the element.UIAwesome\Html\Mixin\HasTemplate
hidden()Sets the hidden attribute.UIAwesome\Html\Attribute\Global\CanBeHidden
id()Sets the id attribute.UIAwesome\Html\Attribute\Global\HasId
lang()Sets the lang attribute.UIAwesome\Html\Attribute\Global\HasLang
list()Sets the list attribute.InputText
maxlength()Sets the maxlength attribute.UIAwesome\Html\Form\Mixin\HasMaxlength
minlength()Sets the minlength attribute.UIAwesome\Html\Form\Mixin\HasMinlength
name()Sets the name attribute.UIAwesome\Html\Attribute\HasName
pattern()Sets the pattern attribute.UIAwesome\Html\Form\Mixin\HasPattern
placeholder()Sets the placeholder attribute.UIAwesome\Html\Form\Mixin\HasPlaceholder
prefix()Sets the prefix content string for the element.UIAwesome\Html\Mixin\HasPrefixCollection
prefixAttributes()Sets the HTML attributes for the prefix element.UIAwesome\Html\Mixin\HasPrefixCollection
prefixClass()Adds a CSS class to the prefix element attributes.UIAwesome\Html\Mixin\HasPrefixCollection
prefixRemoveAttribute()Removes a specific HTML attribute from the prefix element.UIAwesome\Html\Mixin\HasPrefixCollection
prefixSetAttribute()Sets a single HTML attribute for the prefix element.UIAwesome\Html\Mixin\HasPrefixCollection
prefixTag()Sets the tag name for the prefix element.UIAwesome\Html\Mixin\HasPrefixCollection
readonly()Sets the readonly attribute.InputText
removeAriaAttribute()Removes an aria-* attribute.UIAwesome\Html\Attribute\Global\HasAria
removeAttribute()Removes a specific HTML attribute from the element.UIAwesome\Html\Mixin\HasAttributes
removeDataAttribute()Removes a data-* attribute.UIAwesome\Html\Attribute\Global\HasData
removeEvent()Removes an on* event attribute.UIAwesome\Html\Attribute\Global\HasEvents
render() finalRenders the tag with lifecycle hooks.UIAwesome\Html\Core\Base\BaseTag
replaceAttributes()Replaces all HTML attributes for the element.UIAwesome\Html\Mixin\HasAttributes
required()Sets the required attribute.InputText
role()Sets the role attribute.UIAwesome\Html\Attribute\Global\HasRole
size()Sets the size attribute.UIAwesome\Html\Form\Mixin\HasSize
spellcheck()Sets the spellcheck attribute.UIAwesome\Html\Attribute\Global\HasSpellcheck
style()Sets the style attribute.UIAwesome\Html\Attribute\Global\HasStyle
suffix()Sets the suffix content string for the element.UIAwesome\Html\Mixin\HasSuffixCollection
suffixAttributes()Sets the HTML attributes for the suffix element.UIAwesome\Html\Mixin\HasSuffixCollection
suffixClass()Adds a CSS class to the suffix element attributes.UIAwesome\Html\Mixin\HasSuffixCollection
suffixRemoveAttribute()Removes a specific HTML attribute from the suffix element.UIAwesome\Html\Mixin\HasSuffixCollection
suffixSetAttribute()Sets a single HTML attribute for the suffix element.UIAwesome\Html\Mixin\HasSuffixCollection
suffixTag()Sets the tag type for the suffix element.UIAwesome\Html\Mixin\HasSuffixCollection
tabIndex()Sets the tabindex attribute.UIAwesome\Html\Attribute\Global\HasTabindex
tag() staticCreates and configures a new tag instance.UIAwesome\Html\Core\Base\BaseTag
template()Sets the template string for the element.UIAwesome\Html\Mixin\HasTemplate
title()Sets the title attribute.UIAwesome\Html\Attribute\Global\HasTitle
translate()Sets the translate attribute.UIAwesome\Html\Attribute\Global\HasTranslate
type()Sets the type attribute.UIAwesome\Html\Attribute\HasType
value()Sets the value attribute.UIAwesome\Html\Attribute\HasValue
afterRun() protectedPost-processes rendered output.UIAwesome\Html\Core\Event\HasAfterRun
beforeRun() protectedValidates state before rendering.UIAwesome\Html\Core\Event\HasBeforeRun
buildElement() protectedBuilds element output from content and template tokens.UIAwesome\Html\Core\Element\Concern\HasElementBuilder
getTag() protectedReturns the tag enumeration for the <input> element.InputText
loadDefault() protectedReturns the default configuration for the input element.InputText
run() protectedRenders the <input> element with its attributes.InputText
public function autocomplete(string|Stringable|UnitEnum|null $value): static

Sets the autocomplete attribute.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullAutocomplete value, or null to remove the attribute.

Returns

static: New instance with the updated autocomplete attribute.

public function dirname(string|Stringable|UnitEnum|null $value): static

Sets the dirname attribute.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullDirname value, or null to remove the attribute.

Returns

static: New instance with the updated dirname attribute.

public function list(string|Stringable|UnitEnum|null $value): static

Sets the list attribute.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullDatalist ID, or null to remove the attribute.

Returns

static: New instance with the updated list attribute.

public function readonly(bool|null $value): static

Sets the readonly attribute.

Parameters

ParameterTypeDescription
$valuebool|nullReadonly state. Use true to make readonly, false to make editable, or null to remove the attribute.

Returns

static: New instance with the updated readonly attribute.

public function required(bool|null $value): static

Sets the required attribute.

Parameters

ParameterTypeDescription
$valuebool|nullRequired state. Use true to require a value, false to make it optional, or null to remove the attribute.

Returns

static: New instance with the updated required attribute.

protected function getTag(): UIAwesome\Html\Interop\Voids

Returns the tag enumeration for the <input> element.

Returns

Voids: Tag enumeration instance for <input>.

protected function loadDefault(): array<string, mixed>

Returns the default configuration for the input element.

Returns

array<string, mixed>: Default configuration for the input element, including the default type attribute set to text.

protected function run(): string

Renders the <input> element with its attributes.

Returns

string: Rendered HTML for the <input> element.