Overview

Namespaces

  • Evenement
  • None
  • Peridot
    • Console
    • Core
    • Reporter
    • Runner
    • Scope
    • Test
  • Symfony
    • Component
      • Console
        • Command
        • Descriptor
        • Event
        • Exception
        • Formatter
        • Helper
        • Input
        • Logger
        • Output
        • Question
        • Style
        • Tester
        • Tests
          • Command
          • Descriptor
          • Fixtures
          • Formatter
          • Helper
          • Input
          • Logger
          • Output
          • Style
          • Tester

Classes

  • ChoiceQuestion
  • ConfirmationQuestion
  • Question
  • Overview
  • Namespace
  • Class

Class ChoiceQuestion

Represents a choice question.

Symfony\Component\Console\Question\Question
Extended by Symfony\Component\Console\Question\ChoiceQuestion
Namespace: Symfony\Component\Console\Question
Author: Fabien Potencier fabien@symfony.com
Located at Question/ChoiceQuestion.php
Methods summary
public
# __construct( string $question, array $choices, mixed $default = null )

Constructor.

Constructor.

Parameters

$question
The question to ask to the user
$choices
The list of available choices
$default
The default answer to return

Overrides

Symfony\Component\Console\Question\Question::__construct()
public array
# getChoices( )

Returns available choices.

Returns available choices.

Returns

array
public Symfony\Component\Console\Question\ChoiceQuestion
# setMultiselect( boolean $multiselect )

Sets multiselect option.

Sets multiselect option.

When multiselect is set to true, multiple choices can be answered.

Parameters

$multiselect

Returns

Symfony\Component\Console\Question\ChoiceQuestion
The current instance
public boolean
# isMultiselect( )

Returns whether the choices are multiselect.

Returns whether the choices are multiselect.

Returns

boolean
public string
# getPrompt( )

Gets the prompt for choices.

Gets the prompt for choices.

Returns

string
public Symfony\Component\Console\Question\ChoiceQuestion
# setPrompt( string $prompt )

Sets the prompt for choices.

Sets the prompt for choices.

Parameters

$prompt

Returns

Symfony\Component\Console\Question\ChoiceQuestion
The current instance
public Symfony\Component\Console\Question\ChoiceQuestion
# setErrorMessage( string $errorMessage )

Sets the error message for invalid values.

Sets the error message for invalid values.

The error message has a string placeholder (%s) for the invalid value.

Parameters

$errorMessage

Returns

Symfony\Component\Console\Question\ChoiceQuestion
The current instance
Methods inherited from Symfony\Component\Console\Question\Question
getAutocompleterValues(), getDefault(), getMaxAttempts(), getNormalizer(), getQuestion(), getValidator(), isAssoc(), isHidden(), isHiddenFallback(), setAutocompleterValues(), setHidden(), setHiddenFallback(), setMaxAttempts(), setNormalizer(), setValidator()
Peridot API documentation generated by ApiGen