class AutocompleteController
Same name in other branches
- 9 core/modules/system/tests/modules/form_test/src/AutocompleteController.php \Drupal\form_test\AutocompleteController
- 8.9.x core/modules/system/tests/modules/form_test/src/AutocompleteController.php \Drupal\form_test\AutocompleteController
- 11.x core/modules/system/tests/modules/form_test/src/AutocompleteController.php \Drupal\form_test\AutocompleteController
Defines a controller class with methods for autocompletion.
Hierarchy
- class \Drupal\form_test\AutocompleteController
Expanded class hierarchy of AutocompleteController
File
-
core/
modules/ system/ tests/ modules/ form_test/ src/ AutocompleteController.php, line 10
Namespace
Drupal\form_testView source
class AutocompleteController {
/**
* Returns some autocompletion content with a slight delay.
*
* The delay is present so tests can make assertions on the "processing"
* layout of autocompletion.
*
* @return \Symfony\Component\HttpFoundation\JsonResponse
* A JSON response.
*/
public function delayed_autocomplete() {
sleep(1);
return new JsonResponse([
[
'value' => 'value',
'label' => 'label',
],
]);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
AutocompleteController::delayed_autocomplete | public | function | Returns some autocompletion content with a slight delay. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.