Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Console]ChoiceQuestion - choice to get value or key#51199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
maxbeckers wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
frommaxbeckers:patch-40439_choice_keys

Conversation

maxbeckers
Copy link
Contributor

@maxbeckersmaxbeckers commentedAug 1, 2023
edited by OskarStark
Loading

QA
Branch?6.4
Bug fix?no
New feature?yes
Deprecations?no
TicketsFix#40439
LicenseMIT
Doc PRsymfony/symfony-docs#... TBD

Give the developer the Choice to get either the value(s) of a ChoiceQuestion (default behavior) or the key(s) of the selected values.

Example

$choices = ['value_0','value_1','value_2'];$io =newSymfonyStyle($input,$output);$value =$io->choice('Choose something',$choices,'1');// $value would be 'value_1' with default choice$key =$io->choice('Choose something',$choices,'1',true);// $key would be '1' with default choice

chapterjason and dvaeversted reacted with thumbs up emoji
@carsonbotcarsonbot added this to the6.4 milestoneAug 1, 2023
@maxbeckersmaxbeckersforce-pushed thepatch-40439_choice_keys branch 4 times, most recently from34638d8 to6df429aCompareAugust 1, 2023 06:59
@maxbeckersmaxbeckersforce-pushed thepatch-40439_choice_keys branch from6df429a tob52e752CompareAugust 1, 2023 07:03
@nicolas-grekasnicolas-grekas modified the milestones:6.4,7.1Nov 15, 2023
@xabbuhxabbuh modified the milestones:7.1,7.2May 15, 2024
@fabpotfabpot modified the milestones:7.2,7.3Nov 20, 2024
@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

SymfonyStyle ChoiceQuestion - choice to send value or key
5 participants
@maxbeckers@fabpot@nicolas-grekas@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp