Browse files

feature #4879 Documented true regex (WouterJ)

This PR was merged into the 2.7 branch.


Documented true regex

| Q   | A
| --- | ---
| Doc fix? | no
| New docs? | yes (symfony/symfony#11129)
| Applies to | 2.7+
| Fixed tickets | -


6e6bae8 Small grammar-ish fix
050f7ce Documented true regex
  • Loading branch information...
weaverryan committed Jan 30, 2015
2 parents 7c07a44 + 6e6bae8 commit a57db5b1d240d5b6df1b5a8b077b280c17233420
Showing with 18 additions and 0 deletions.
  1. +18 −0 components/console/helpers/questionhelper.rst
@@ -41,6 +41,24 @@ The second argument to
is the default value to return if the user doesn't enter any input. Any other
input will ask the same question again.
.. tip::
You can customize the regex used to check if the answer means "yes" in the
third argument of the constructor. For instance, to allow anything that
starts with either ``y`` or ``j``, you would set it to::
$question = new ConfirmationQuestion(
'Continue with this action?',
The regex defaults to ``/^y/i``.
.. versionadded:: 2.7
The regex argument was introduced in Symfony 2.7. Before, only answers
starting with ``y`` were considered as "yes".
Asking the User for Information

0 comments on commit a57db5b

Please sign in to comment.