Permalink
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (26 sloc) 745 Bytes

Use JQueryAutocomplete to MongoDB values

Minimal configuration:

# app/config/config.yml
genemu_form:
    autocompleter:
        mongodb: true

Usage:

<?php
// ...
public function buildForm(FormBuilder $builder, array $options)
{
    $builder
        ->add('member', 'genemu_jqueryautocompleter_document', array(
            'class' => 'Genemu\Bundle\DocumentBundle\Document\Member',
        ))
        ->add('cities', 'genemu_jqueryautocompleter_document', array(
            'class' => 'Genemu\Bundle\DocumentBundle\Document\City',
            'multiple' => true
        ));
}

Extra

Ajax MongoDB