Skip to content

Update console dialog helper documentation #7572

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion components/console/helpers/dialoghelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,15 @@ in the console, so it is a good practice to put some useful information in it. T
function should also return the value of the user's input if the validation was successful.

You can set the max number of times to ask in the ``$attempts`` argument.
If you reach this max number it will use the default value.
Using ``false`` means the amount of attempts is infinite.
The user will be asked as long as they provide an invalid answer and will only
be able to proceed if their input is valid.

Each time the user is asked the question, if no answer is supplied, the default
one is used (and validated with the ``$validator`` callback) and the remaining
number of attempts is displayed. If the last attempt is reached, the application
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, "the remaining number of attempts is displayed" sounds wrong, only an error message is displayed.

throws an exception and ends its execution.

Validating a Hidden Response
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down