Skip to content

Commit 8f7ca7f

Browse files
committed
Merge branch '7.3' into 7.4
* 7.3: Minor tweaks [Console] Adding custom indices
2 parents 605e9d2 + bc2d6e0 commit 8f7ca7f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

console/style.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ User Input Methods
353353

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

356+
Choice questions display both the choice value and a numeric index, which
357+
starts from ``0`` by default. To use custom indices, pass an array with
358+
custom numeric keys as the choice values::
359+
360+
$io->choice('Select the queue to analyze', [5 => 'queue1', 6 => 'queue2', 7 => 'queue3']);
361+
356362
Finally, you can allow users to select multiple choices. To do so, users must
357363
separate each choice with a comma (e.g. typing ``1, 2`` will select choice 1
358364
and 2)::

0 commit comments

Comments
 (0)