From b9e2005cc3e1d1fde6d2f97382a6d37bac14bc8a Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Sat, 18 Jan 2025 13:19:11 +0100 Subject: [PATCH] [Console] Adding associative array Page: https://symfony.com/doc/6.4/components/console/helpers/questionhelper.html#let-the-user-choose-from-a-list-of-answers --- components/console/helpers/questionhelper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/console/helpers/questionhelper.rst b/components/console/helpers/questionhelper.rst index 2670ec3084a..e8c2d40a470 100644 --- a/components/console/helpers/questionhelper.rst +++ b/components/console/helpers/questionhelper.rst @@ -128,7 +128,7 @@ but ``red`` could be set instead (could be more explicit):: $question = new ChoiceQuestion( 'Please select your favorite color (defaults to red)', // choices can also be PHP objects that implement __toString() method - ['red', 'blue', 'yellow'], + ['red', 'blue', 'yellow'], // pass an associative array to display custom indices: [3 => 'red', 7 => 'blue'] 0 ); $question->setErrorMessage('Color %s is invalid.'); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy