ChoiceQuestion::setPrompt()

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

ChoicesToBooleanArrayTransformer deprecated

class ChoicesToBooleanArrayTransformer implements DataTransformerInterface deprecated since version 2.7, to be removed in 3.0. Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList} instead. Methods __construct(ChoiceListInterface $choiceList) mixed transform(mixed $array) Transforms an array of choices to a format appropriate for the nested checkboxes/radio buttons. mixed reverseTransform(mixed $values) Transforms a checkbox/radio button array to an array of choices.

ChoiceQuestion::getPrompt()

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

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

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

ChoiceQuestion::getChoices()

array getChoices() Returns available choices. Return Value array

ChoiceListInterface::getStructuredValues()

string[] getStructuredValues() Returns the values in the structure originally passed to the list. Contrary to {@link getValues()}, the result is indexed by the original keys of the choices. If the original array contained nested arrays, these nested arrays are represented here as well: $form->add('field', 'choice', array( 'choices' => array( 'Decided' => array('Yes' => true, 'No' => false), 'Undecided' => array('Maybe' => null), ), ));

ChoiceListInterface::getValues()

string[] getValues() Returns the values for the choices. The values are strings that do not contain duplicates. Return Value string[] The choice values

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