ChoiceQuestion::setPrompt()

ChoiceQuestion setPrompt(string $prompt) Sets the prompt for choices. Parameters string $prompt Return Value ChoiceQuestion The current instance

ChoiceQuestion::setMultiselect()

ChoiceQuestion setMultiselect(bool $multiselect) Sets multiselect option. When multiselect is set to true, multiple choices can be answered. Parameters bool $multiselect Return Value ChoiceQuestion The current instance

ChoiceQuestion::setErrorMessage()

ChoiceQuestion setErrorMessage(string $errorMessage) Sets the error message for invalid values. The error message has a string placeholder (%s) for the invalid value. Parameters string $errorMessage Return Value ChoiceQuestion The current instance

ChoiceQuestion::isMultiselect()

bool isMultiselect() Returns whether the choices are multiselect. Return Value bool

ChoiceQuestion::getPrompt()

string getPrompt() Gets the prompt for choices. Return Value string

ChoiceQuestion::getChoices()

array getChoices() Returns available choices. Return Value array

ChoiceQuestion

class ChoiceQuestion extends Question Represents a choice question. Methods __construct(string $question, array $choices, mixed $default = null) Constructor. string getQuestion() Returns the question. from Question mixed getDefault() Returns the default answer. from Question bool isHidden() Returns whether the user response must be hidden. from Question Question setHidden(bool $hidden) Sets whether the user response must be hidden or not. from Question bool isHiddenF

ChoiceLoaderInterface

interface ChoiceLoaderInterface Loads a choice list. The methods {@link loadChoicesForValues()} and {@link loadValuesForChoices()} can be used to load the list only partially in cases where a fully-loaded list is not necessary. Methods ChoiceListInterface loadChoiceList(null|callable $value = null) Loads a list of choices. array loadChoicesForValues(array $values, null|callable $value = null) Loads the choices corresponding to the given values. string[] loadValuesForChoices(arr

ChoiceListView

class ChoiceListView Represents a choice list in templates. A choice list contains choices and optionally preferred choices which are displayed in the very beginning of the list. Both choices and preferred choices may be grouped in {@link ChoiceGroupView} instances. Properties ChoiceGroupView[]|ChoiceView[] $choices The choices. ChoiceGroupView[]|ChoiceView[] $preferredChoices The preferred choices. Methods __construct(array $choices = array(), array $preferredChoices = array())

ChoiceListInterface::getValuesForChoices()

string[] getValuesForChoices(array $choices) Returns the values corresponding to the given choices. The values are returned with the same keys and in the same order as the corresponding choices in the given array. Parameters array $choices An array of choices. Non-existing choices in this array are ignored Return Value string[] An array of choice values