This is the Gist repository for my article How to create a custom Autocomplete using the Drupal 8 Form API.
Be aware that this article has been wrote for the Blog of Antistatique — Web Agency in Lausanne, Switzerland. A place where I work as Full Stack Web Developer.
Feel free to read it the full article on Medium or check it out on Antistatique.
Content of this gist :
- ArticleAutocompleteForm.php : The form containing the autocomplete element.
- ArticleAutoCompleteController.php : The controller which deal with buisness logic to populate autocomplete values.
- my_module/my_module.routing.yml : The routing to expose the controller action.
Be careful with the spelling of
nodeStorage
in your fileArticleAutoCompleteController.php
! Awesome article nevertheless :)