class ConfirmObject implements ObjectContract

Properties

protected PlainTextOnlyTextObject $title

A plain_text-only text object that defines the dialog's title.

protected TextObject $text

A text object that defines the explanatory text that appears in the confirm dialog.

protected PlainTextOnlyTextObject $confirm

A plain_text-only text object to define the text of the button that confirms the action.

protected PlainTextOnlyTextObject $deny

A plain_text-only text object to define the text of the button that cancels the action.

protected string|null $style

Defines the color scheme applied to the confirm button.

Methods

__construct(string $text = 'Please confirm this action.')

Create a new confirm object instance.

title(string $title)

Set the title of the confirm object.

text(string $text)

Set the text of the confirm object.

confirm(string $label)

Set the confirm button label of the confirm object.

deny(string $label)

Set the deny button label of the confirm object.

danger()

Marks the confirm dialog as dangerous.

array
toArray()

Get the instance as an array.

Details

at line 52
__construct(string $text = 'Please confirm this action.')

Create a new confirm object instance.

Parameters

string $text

at line 63
PlainTextOnlyTextObject title(string $title)

Set the title of the confirm object.

Parameters

string $title

Return Value

PlainTextOnlyTextObject

at line 73
TextObject text(string $text)

Set the text of the confirm object.

Parameters

string $text

Return Value

TextObject

at line 83
PlainTextOnlyTextObject confirm(string $label)

Set the confirm button label of the confirm object.

Parameters

string $label

Return Value

PlainTextOnlyTextObject

at line 93
PlainTextOnlyTextObject deny(string $label)

Set the deny button label of the confirm object.

Parameters

string $label

Return Value

PlainTextOnlyTextObject

at line 103
ConfirmObject danger()

Marks the confirm dialog as dangerous.

Return Value

ConfirmObject

at line 113
array toArray()

Get the instance as an array.

Return Value

array