helpers\BaseConsole prompt()

prompt() public static method

Prompts the user for input and validates it

public static string prompt ( $text, $options = [] )
$text string

Prompt string

$options array

The options to validate the input:

  • required: whether it is required or not
  • default: default value if no input is inserted by the user
  • pattern: regular expression pattern to validate user input
  • validator: a callable function to validate input. The function must accept two parameters:
  • input: the user input to validate
  • error: the error value passed by reference if validation failed.
return string

The user input

doc_Yii
2016-10-30 17:04:37
Comments
Leave a Comment

Please login to continue.