Skip to main content

Confirm

Confirm widgetConfirm widget

A Yes/No gate. It collects a bool.

$p->confirm('organic', 'Organic only?')
->default(TRUE); // Which choice starts highlighted (defaults to No).

Runnable script: playground/02-widgets/confirm.php.

Options

NameDescriptionRequiredDefault
default()Which choice starts highlighted - TRUE for Yes, FALSE for No.NoFALSE (No)

Keyboard

KeyAction
y / nChoose Yes / No directly
/ / Space / / Flip the choice
EnterAccept the current choice
EscCancel

Display modes

In all four display modes - Unicode or ASCII, colour on or off:

ANSINo ANSI
UnicodeConfirm: Unicode + ANSIConfirm: Unicode + ANSIConfirm: Unicode + No ANSIConfirm: Unicode + No ANSI
ASCIIConfirm: ASCII + ANSIConfirm: ASCII + ANSIConfirm: ASCII + No ANSIConfirm: ASCII + No ANSI