Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Question.php

function Question::setAutocompleterCallback

Sets the callback function used for the autocompleter.

The callback is passed the user input as argument and should return an iterable of corresponding suggestions.

Return value

$this

1 call to Question::setAutocompleterCallback()
Question::setAutocompleterValues in vendor/symfony/console/Question/Question.php
Sets values for the autocompleter.

File

vendor/symfony/console/Question/Question.php, line 176

Class

Question
Represents a Question.

Namespace

Symfony\Component\Console\Question

Code

public function setAutocompleterCallback(?callable $callback) : static {
    if ($this->hidden && null !== $callback) {
        throw new LogicException('A hidden question cannot use the autocompleter.');
    }
    $this->autocompleterCallback = null === $callback ? null : $callback(...);
    return $this;
}
RSS feed
Powered by Drupal