diff --git a/framework/helpers/BaseConsole.php b/framework/helpers/BaseConsole.php index 70323c2d241..b32358d8cc5 100644 --- a/framework/helpers/BaseConsole.php +++ b/framework/helpers/BaseConsole.php @@ -805,6 +805,16 @@ public static function prompt($text, $options = []) /** * Asks user to confirm by typing y or n. * + * A typical usage looks like the following: + * + * ```php + * if (Console::confirm("Are you sure?")) { + * echo "user typed yes\n"; + * } else { + * echo "user typed no\n"; + * } + * ``` + * * @param string $message to print out before waiting for user input * @param bool $default this value is returned if no selection is made. * @return bool whether user confirmed