class SelectOption implements Arrayable

Properties

protected TextObject $text

The option text.

protected string $value

The option value.

Methods

__construct(string $text, Stringable|string|int|float|bool $value)

Create a new select option instance.

void
text(string $text)

Set the option's text value.

void
value(Stringable|string|int|float|bool $value)

Set the option's value.

array
toArray()

Convert the select option to an array.

Details

at line 27
__construct(string $text, Stringable|string|int|float|bool $value)

Create a new select option instance.

Parameters

string $text
Stringable|string|int|float|bool $value

at line 36
protected void text(string $text)

Set the option's text value.

Parameters

string $text

Return Value

void

at line 44
protected void value(Stringable|string|int|float|bool $value)

Set the option's value.

Parameters

Stringable|string|int|float|bool $value

Return Value

void

at line 62
array toArray()

Convert the select option to an array.

Return Value

array