Method | Description | |
---|---|---|
ask ( Symfony\Component\Console\Output\OutputInterface $output, string | array $question, string $default = null ) : string | Asks a question to the user. | |
askAndValidate ( Symfony\Component\Console\Output\OutputInterface $output, string | array $question, callback $validator, integer $attempts = false, string $default = null ) : mixed | Asks for a value and validates the response. | |
askConfirmation ( Symfony\Component\Console\Output\OutputInterface $output, string | array $question, boolean $default = true ) : boolean | Asks a confirmation to the user. | |
getName ( ) | Returns the helper's canonical name | |
setInputStream ( resource $stream ) | Sets the input stream to read from when interacting with the user. |
public ask ( Symfony\Component\Console\Output\OutputInterface $output, string | array $question, string $default = null ) : string | ||
$output | Symfony\Component\Console\Output\OutputInterface | |
$question | string | array | The question to ask |
$default | string | The default answer if none is given by the user |
return | string | The user answer |
public askAndValidate ( Symfony\Component\Console\Output\OutputInterface $output, string | array $question, callback $validator, integer $attempts = false, string $default = null ) : mixed | ||
$output | Symfony\Component\Console\Output\OutputInterface | |
$question | string | array | |
$validator | callback | A PHP callback |
$attempts | integer | Max number of times to ask before giving up (false by default, which means infinite) |
$default | string | The default answer if none is given by the user |
return | mixed |
public askConfirmation ( Symfony\Component\Console\Output\OutputInterface $output, string | array $question, boolean $default = true ) : boolean | ||
$output | Symfony\Component\Console\Output\OutputInterface | |
$question | string | array | The question to ask |
$default | boolean | The default answer if the user enters nothing |
return | boolean | true if the user has confirmed, false otherwise |
public setInputStream ( resource $stream ) | ||
$stream | resource | The input stream |