Last active
July 13, 2022 11:19
-
-
Save mficzel/da4b29cf11dc0e60881133fa4510f37d to your computer and use it in GitHub Desktop.
Use Symfony console helper for selection with autocomplete
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @see https://symfony.com/doc/current/components/console/helpers/questionhelper.html | |
$bundles = ['AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle']; | |
$question = new Question('Please enter the name of a bundle: ', 'FooBundle'); | |
$question->setAutocompleterValues($bundles); | |
$input = new SymfonyStringInput(''); | |
$output = new SymfonyConsoleOutput(); | |
$helper = new QuestionHelper(); | |
$result = $helper->ask($input, $output, $question); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment