Skip to content

Commit 0104271

Browse files
committed
Merge branch '6.4' into 7.2
* 6.4: Minor tweaks [Console] Adding custom indices
2 parents d83a67e + 75685fe commit 0104271

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
@@ -327,6 +327,12 @@ User Input Methods
327327

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

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

0 commit comments

Comments
 (0)