From fbf40a7d594bbfd22930b8f85584d217dc148844 Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Sun, 5 Mar 2017 15:26:47 +0000 Subject: [PATCH 1/2] Update console dialog helper documentation --- components/console/helpers/dialoghelper.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/console/helpers/dialoghelper.rst b/components/console/helpers/dialoghelper.rst index 645aaac9fa7..4c27b55f92d 100644 --- a/components/console/helpers/dialoghelper.rst +++ b/components/console/helpers/dialoghelper.rst @@ -142,11 +142,14 @@ 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 it's validated using the ``$validator`` callback. +If the validator throws an exception on the last attempt, the exception is displayed to the user. + Validating a Hidden Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 400f4100a7f8bd1795c800844b7dd3b93789c316 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 6 Jul 2017 12:58:27 +0200 Subject: [PATCH 2/2] Minor reword --- components/console/helpers/dialoghelper.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/console/helpers/dialoghelper.rst b/components/console/helpers/dialoghelper.rst index 4c27b55f92d..13f409837c0 100644 --- a/components/console/helpers/dialoghelper.rst +++ b/components/console/helpers/dialoghelper.rst @@ -146,9 +146,10 @@ 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 it's validated using the ``$validator`` callback. -If the validator throws an exception on the last attempt, the exception is displayed to the user. +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 +throws an exception and ends its execution. Validating a Hidden Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~