class StaticSelectElement extends SelectElement

Traits

Properties

protected string $actionId

An identifier for this action.

from  SelectElement
protected PlainTextOnlyTextObject|null $placeholder

A plain_text only text object that defines the placeholder text shown on the menu.

from  SelectElement
protected bool|null $focusOnLoad

Indicates whether the element should automatically gain focus when the view loads.

from  SelectElement

Methods

id(string $id)

Set the action ID for the select.

placeholder(string $text)

Set the placeholder text.

focus(bool $focus = true)

Set whether the element should automatically gain focus when the view loads.

array
toArray()

Get the instance as an array.

__construct(string|null $text = null)

Create a new static select element instance.

addOption(string $text, string $value)

Add an option to the select element.

initialOption(string $value)

Set the default selected option for the select element.

Details

in SelectElement at line 42
SelectElement id(string $id)

Set the action ID for the select.

Parameters

string $id

Return Value

SelectElement

in SelectElement at line 56
SelectElement placeholder(string $text)

Set the placeholder text.

Parameters

string $text

Return Value

SelectElement

in SelectElement at line 66
SelectElement focus(bool $focus = true)

Set whether the element should automatically gain focus when the view loads.

Parameters

bool $focus

Return Value

SelectElement

at line 64
array toArray()

Get the instance as an array.

Return Value

array

at line 30
__construct(string|null $text = null)

Create a new static select element instance.

Parameters

string|null $text

at line 38
StaticSelectElement addOption(string $text, string $value)

Add an option to the select element.

Parameters

string $text
string $value

Return Value

StaticSelectElement

at line 48
StaticSelectElement initialOption(string $value)

Set the default selected option for the select element.

Parameters

string $value

Return Value

StaticSelectElement