Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3693865

Browse files
committed
minor #7572 Update console dialog helper documentation (Ahmed TAILOULOUTE, javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- Update console dialog helper documentation `If you reach this max number it will use the default value.` is not always true, on the last attempt we can supply an answer and the default one is not used Actually the default answer is used each time the user is asked the question if the user didn't specify any answer and it's validated using the `validator` callback Commits ------- 400f410 Minor reword fbf40a7 Update console dialog helper documentation
2 parents b476a97 + 400f410 commit 3693865

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/console/helpers/dialoghelper.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,15 @@ in the console, so it is a good practice to put some useful information in it. T
142142
function should also return the value of the user's input if the validation was successful.
143143

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

149+
Each time the user is asked the question, if no answer is supplied, the default
150+
one is used (and validated with the ``$validator`` callback) and the remaining
151+
number of attempts is displayed. If the last attempt is reached, the application
152+
throws an exception and ends its execution.
153+
150154
Validating a Hidden Response
151155
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152156

0 commit comments

Comments
 (0)