Helper\DialogHelper (Component\Console)
Symfony\Component\Console\Helper\DialogHelper
class DialogHelper extends InputAwareHelper
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
public setHelperSet(HelperSet $helperSet = null)
Sets the helper set associated with this helper.
public HelperSet getHelperSet()
Gets the helper set associated with this helper.
static public int strlen(string $string)
Returns the length of a string, using mb_strwidth if it is available.
static public formatTime($secs)
static public formatMemory($memory)
static public strlenWithoutDecoration(OutputFormatterInterface $formatter, $string)
public setInput(InputInterface $input)
Sets the Console Input.
public __construct($triggerDeprecationError = true)
public 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.
public string ask(OutputInterface $output, string|array $question, string $default = null, array $autocomplete = null)
Asks a question to the user.
public 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.
public string askHiddenResponse(OutputInterface $output, string|array $question, bool $fallback = true)
Asks a question to the user, the response is hidden.
public 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.
public 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.
public setInputStream(resource $stream)
Sets the input stream to read from when interacting with the user.
This is mainly useful for testing purpose.
public resource|null getInputStream()
Returns the helper's input stream.
public string getName()
Returns the canonical name of this helper.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/Console/Helper/DialogHelper.html