Skip to content

Commit 7b3e12c

Browse files
committed
Merge branch 'patch-1' of github.com:lmcd/symfony-docs into lmcd-patch-1
Conflicts: components/console/introduction.rst
2 parents 48e7ded + 6533268 commit 7b3e12c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

components/console/helpers/dialoghelper.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,24 @@ The user will be asked "Please enter the name of the bundle". She can type
5353
some name which will be returned by the ``ask`` method. If she leaves it empty,
5454
the default value (``AcmeDemoBundle`` here) is returned.
5555

56+
Autocompletion
57+
~~~~~~~~~~~~~~
58+
59+
.. versionadded:: 2.2
60+
Autocompletion for questions was added in Symfony 2.2.
61+
62+
You can also specify an array of potential answers for a given question. These
63+
will be autocompleted as the user types::
64+
65+
$dialog = $this->getHelperSet()->get('dialog');
66+
$bundleNames = array('AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle');
67+
$name = $dialog->ask(
68+
$output,
69+
'Please enter the name of a bundle',
70+
'FooBundle',
71+
$bundleNames
72+
);
73+
5674
Hiding the User's Response
5775
~~~~~~~~~~~~~~~~~~~~~~~~~~
5876

0 commit comments

Comments
 (0)