InputImage
API reference › HTML › Form › InputImage
Renders the HTML <input type="image"> element.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/image.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$attributes protected | mixed[] | HTML attributes array used by the implementing class. Default: []. | UIAwesome\ |
$prefix protected | string | Prefix content string assigned to the element. Default: ''. | UIAwesome\ |
$prefixAttributes protected | array | HTML attributes array for the prefix element. Default: []. | UIAwesome\ |
$prefixTag protected | false|UnitEnum | Tag name for the prefix element, or false to disable. Default: false. | UIAwesome\ |
$suffix protected | string | Suffix content string assigned to the element. Default: ''. | UIAwesome\ |
$suffixAttributes protected | array | HTML attributes array for the suffix element. Default: []. | UIAwesome\ |
$suffixTag protected | false|UnitEnum | Tag name for the suffix element, or false to disable. Default: false. | UIAwesome\ |
$template protected | string | Template string used for constructing the HTML tag. Default: ''. | UIAwesome\ |
Methods
Section titled “Methods”Method details
Section titled “Method details”alt()
Section titled “alt() ”public function alt(string|Stringable|UnitEnum|null $value): staticSets the alt attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Alternative text for the element, or null to remove the attribute. |
Returns
static: New instance with the updated alt attribute.
formaction()
Section titled “formaction() ”public function formaction(string|Stringable|UnitEnum|null $value): staticSets the formaction attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | URL for form submission, or null to remove the attribute. |
Returns
static: New instance with the updated formaction attribute.
formenctype()
Section titled “formenctype() ”public function formenctype(string|Stringable|UnitEnum|null $value): staticSets the formenctype attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Encoding type for form submission, or null to remove the attribute. |
Returns
static: New instance with the updated formenctype attribute.
formmethod()
Section titled “formmethod() ”public function formmethod(string|Stringable|UnitEnum|null $value): staticSets the formmethod attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | HTTP method for form submission, or null to remove the attribute. |
Returns
static: New instance with the updated formmethod attribute.
formnovalidate()
Section titled “formnovalidate() ”public function formnovalidate(bool|null $value): staticSets the formnovalidate attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | bool| | Whether to bypass form validation, or null to remove the attribute. |
Returns
static: New instance with the updated formnovalidate attribute.
formtarget()
Section titled “formtarget() ”public function formtarget(string|Stringable|UnitEnum|null $value): staticSets the formtarget attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Browsing context for form submission response, or null to remove the attribute. |
Returns
static: New instance with the updated formtarget attribute.
height()
Section titled “height() ”public function height(int|string|Stringable|UnitEnum|null $value): staticSets the height attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | int|Stringable|UnitEnum| | Height value in pixels or CSS units, or null to remove the attribute. |
Returns
static: New instance with the updated height attribute.
src()
Section titled “src() ”public function src(string|Stringable|UnitEnum|null $value): staticSets the src attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Image source URL or path, or null to remove the attribute. |
Returns
static: New instance with the updated src attribute.
width()
Section titled “width() ”public function width(int|string|Stringable|UnitEnum|null $value): staticSets the width attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | int|Stringable|UnitEnum| | Width value in pixels or CSS units, or null to remove the attribute. |
Returns
static: New instance with the updated width attribute.
getTag()
Section titled “getTag() ”protected function getTag(): UIAwesome\Html\Interop\VoidsReturns the tag enumeration for the <input> element.
Returns
Voids: Tag enumeration instance for <input>.
loadDefault()
Section titled “loadDefault() ”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 image.
run()
Section titled “run() ”protected function run(): stringRenders the <input> element with its attributes.
Returns
string: Rendered HTML for the <input> element.