Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions console/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ User Input Methods

$io->choice('Select the queue to analyze', ['queue1', 'queue2', 'queue3'], 'queue1');

Choice questions display both the choice value and a numeric index, which starts from 0
by default. To use custom indices, pass an array with custom numeric keys as the choice values::

$io->choice('Select the queue to analyze', [5 => 'queue1', 6 => 'queue2', 7 => 'queue3']);

Finally, you can allow users to select multiple choices. To do so, users must
separate each choice with a comma (e.g. typing ``1, 2`` will select choice 1
and 2)::
Expand Down