Confirm
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
| Name | Description | Required | Default |
|---|---|---|---|
default() | Which choice starts highlighted - TRUE for Yes, FALSE for No. | No | FALSE (No) |
Keyboard
| Key | Action |
|---|---|
y / n | Choose Yes / No directly |
← / → / Space / ↑ / ↓ | Flip the choice |
Enter | Accept the current choice |
Esc | Cancel |
Display modes
In all four display modes - Unicode or ASCII, colour on or off:
| ANSI | No ANSI | |
| Unicode | ||
| ASCII |