Passing database values to JavaScript under Symfony?

  communication, database, javascript, symfony

I am creating an autocomplete tool for a specific input field in a form. The autocomplete is fed by a JavaScript array containing the values to suggest, and it works the way I want with fake values. But now, I want to feed the array with actual values from my MySQL database, meaning I have to get my DB’s values (an entire column’s values, it happens) to this array somehow.

I’ve been browsing a lot, but haven’t tried anything by lack of understanding of the code and mechanisms. I am using HTML-CSS-JS for the front end, Symfony and Doctrine for the back-end and DB communication with MySQL. Any ideas?

Source: Symfony Questions