File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
components/console/helpers Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,24 @@ The second argument to
4141is the default value to return if the user doesn't enter any input. Any other
4242input will ask the same question again.
4343
44+ .. tip ::
45+
46+ You can customize the regex used to check if the answer means "yes" in the
47+ third argument of the constructor. For instance, to allow anything that
48+ starts with either ``y `` or ``j ``, you would set it to::
49+
50+ $question = new ConfirmationQuestion(
51+ 'Continue with this action?',
52+ false,
53+ '/^(y|j)/i'
54+ );
55+
56+ The regex defaults to ``/^y/i ``.
57+
58+ .. versionadded :: 2.7
59+ The regex argument was introduced in Symfony 2.7, before only answers
60+ starting with ``y `` were considered as yes.
61+
4462Asking the User for Information
4563-------------------------------
4664
You can’t perform that action at this time.
0 commit comments