From 7c98000391c5a57308d5b3f9b058379941a1b3bb Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sat, 7 Jan 2017 21:15:30 +0100 Subject: [PATCH] Update Controller.php --- framework/console/Controller.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/framework/console/Controller.php b/framework/console/Controller.php index edfa9aec1a8..09393ef4753 100644 --- a/framework/console/Controller.php +++ b/framework/console/Controller.php @@ -282,6 +282,16 @@ public function prompt($text, $options = []) /** * Asks user to confirm by typing y or n. * + * A typical usage looks like the following: + * + * ```php + * if ($this->confirm("Are you sure?")) { + * echo "user typed yes\n"; + * } else { + * echo "user typed no\n"; + * } + * ``` + * * @param string $message to echo out before waiting for user input * @param bool $default this value is returned if no selection is made. * @return bool whether user confirmed.