AutocompleteController.php

Same filename in other branches
  1. 8.9.x core/modules/system/tests/modules/form_test/src/AutocompleteController.php
  2. 10 core/modules/system/tests/modules/form_test/src/AutocompleteController.php
  3. 11.x core/modules/system/tests/modules/form_test/src/AutocompleteController.php

Namespace

Drupal\form_test

File

core/modules/system/tests/modules/form_test/src/AutocompleteController.php

View source
<?php

namespace Drupal\form_test;

use Symfony\Component\HttpFoundation\JsonResponse;

/**
 * Defines a controller class with methods for autocompletion.
 */
class AutocompleteController {
    
    /**
     * Returns some autocompletion content.
     *
     * @return \Symfony\Component\HttpFoundation\JsonResponse
     *   A JSON response.
     */
    public function autocomplete1() {
        return new JsonResponse([
            'key' => 'value',
        ]);
    }

}

Classes

Title Deprecated Summary
AutocompleteController Defines a controller class with methods for autocompletion.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.