mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Update BaseConsole.php
This commit is contained in:
@ -805,6 +805,16 @@ class BaseConsole
|
||||
/**
|
||||
* 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
|
||||
|
Reference in New Issue
Block a user