Autocomplete upload widget and form type for Symfony
This package provides:
an almost dependency-free autocomplete source API, with a generic controller that should be suitable for most frameworks,
a Symfony bundle that brings a form widget, source registration, and the associated controller for autocompleting things into forms.
composer require makinacorpus/autocomplete-bundle
You also need jQuery installed (sorry, this might change later).
Register the routing.yml file in your
autocomplete: resource: "@AutocompleteBundle/Resources/config/routing.yml" prefix: /
And the associated form theme in your
twig: debug: "%kernel.debug%" strict_variables: false form_themes: # ... - "AutocompleteBundle:Form:fields.html.twig"
And it should probably work.
First, implement an
class, that is meant to reflect the business objects in which to autocomplete.
Then just use the
MakinaCorpus\AutocompleteBundle\Form\Type\TextAutocompleteType form type
in your own form builders, and set the source class name as the
source parameter for the form type.