Метод | Описание | |
---|---|---|
__construct ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) | QuestionHelper constructor. | |
askInput ( string $questionText, mixed $default = null ) : string | Ask a simple question which requires input. | |
choose ( array $items, string $text = 'Enter a number to choose an item:', mixed $default = null ) : mixed | ||
confirm ( string $questionText, boolean $default = true ) : boolean | Ask the user to confirm an action. | |
setInput ( Symfony\Component\Console\Input\InputInterface $input ) | ||
setOutput ( Symfony\Component\Console\Output\OutputInterface $output ) |
public __construct ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) | ||
$input | Symfony\Component\Console\Input\InputInterface | |
$output | Symfony\Component\Console\Output\OutputInterface |
public choose ( array $items, string $text = 'Enter a number to choose an item:', mixed $default = null ) : mixed | ||
$items | array | An associative array of choices. |
$text | string | Some text to precede the choices. |
$default | mixed | A default (as a key in $items). |
Результат | mixed | The chosen item (as a key in $items). |
public setInput ( Symfony\Component\Console\Input\InputInterface $input ) | ||
$input | Symfony\Component\Console\Input\InputInterface |
public setOutput ( Symfony\Component\Console\Output\OutputInterface $output ) | ||
$output | Symfony\Component\Console\Output\OutputInterface |