class DialogHelper extends InputAwareHelper
deprecated
since version 2.5, to be removed in 3.0. Use {@link \Symfony\Component\Console\Helper\QuestionHelper} instead.
The Dialog class provides helpers to interact with the user.
Methods
setHelperSet(HelperSet $helperSet = null) Sets the helper set associated with this helper. | from Helper | |
HelperSet | getHelperSet() Gets the helper set associated with this helper. | from Helper |
static int | strlen(string $string) Returns the length of a string, using mb_strwidth if it is available. | from Helper |
static | formatTime($secs) | from Helper |
static | formatMemory($memory) | from Helper |
static | strlenWithoutDecoration(OutputFormatterInterface $formatter, $string) | from Helper |
setInput(InputInterface $input) Sets the Console Input. | from InputAwareHelper | |
__construct($triggerDeprecationError = true) | ||
int|string|array | select(OutputInterface $output, string|array $question, array $choices, bool|string $default = null, bool|int $attempts = false, string $errorMessage = 'Value "%s" is invalid', bool $multiselect = false) Asks the user to select a value. | |
string | ask(OutputInterface $output, string|array $question, string $default = null, array $autocomplete = null) Asks a question to the user. | |
bool | askConfirmation(OutputInterface $output, string|array $question, bool $default = true) Asks a confirmation to the user. | |
string | askHiddenResponse(OutputInterface $output, string|array $question, bool $fallback = true) Asks a question to the user, the response is hidden. | |
mixed | askAndValidate(OutputInterface $output, string|array $question, callable $validator, int|false $attempts = false, string $default = null, array $autocomplete = null) Asks for a value and validates the response. | |
string | askHiddenResponseAndValidate(OutputInterface $output, string|array $question, callable $validator, int|false $attempts = false, bool $fallback = true) Asks for a value, hide and validates the response. | |
setInputStream(resource $stream) Sets the input stream to read from when interacting with the user. | ||
resource|null | getInputStream() Returns the helper's input stream. | |
string | getName() Returns the canonical name of this helper. |
Details
setHelperSet(HelperSet $helperSet = null)
Sets the helper set associated with this helper.
HelperSet getHelperSet()
Gets the helper set associated with this helper.
static int strlen(string $string)
Returns the length of a string, using mb_strwidth if it is available.
static formatTime($secs)
static formatMemory($memory)
static strlenWithoutDecoration(OutputFormatterInterface $formatter, $string)
setInput(InputInterface $input)
Sets the Console Input.
__construct($triggerDeprecationError = true)
int|string|array select(OutputInterface $output, string|array $question, array $choices, bool|string $default = null, bool|int $attempts = false, string $errorMessage = 'Value "%s" is invalid', bool $multiselect = false)
Asks the user to select a value.
string ask(OutputInterface $output, string|array $question, string $default = null, array $autocomplete = null)
Asks a question to the user.
bool askConfirmation(OutputInterface $output, string|array $question, bool $default = true)
Asks a confirmation to the user.
The question will be asked until the user answers by nothing, yes, or no.
string askHiddenResponse(OutputInterface $output, string|array $question, bool $fallback = true)
Asks a question to the user, the response is hidden.
mixed askAndValidate(OutputInterface $output, string|array $question, callable $validator, int|false $attempts = false, string $default = null, array $autocomplete = null)
Asks for a value and validates the response.
The validator receives the data to validate. It must return the validated data when the data is valid and throw an exception otherwise.
string askHiddenResponseAndValidate(OutputInterface $output, string|array $question, callable $validator, int|false $attempts = false, bool $fallback = true)
Asks for a value, hide and validates the response.
The validator receives the data to validate. It must return the validated data when the data is valid and throw an exception otherwise.
setInputStream(resource $stream)
Sets the input stream to read from when interacting with the user.
This is mainly useful for testing purpose.
resource|null getInputStream()
Returns the helper's input stream.
string getName()
Returns the canonical name of this helper.
Please login to continue.