Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Bilal Amarni bamarni
42 lines (35 sloc) 1.051 kb

Use JQueryAutocomplete to suggest values on a text field

Minimal configuration:

# app/config/config.yml
genemu_form:
    autocomplete: ~

Usage:

<?php
// ...
public function buildForm(FormBuilder $builder, array $options)
{
    $builder
        // Text suggestions
        ->add('soccer_player', 'genemu_jqueryautocomplete_text', array(
            'suggestions' => array(
                'Ozil',
                'Van Persie'
            ),
        ))
        // Suggestions with doctrine orm
        ->add('soccer_player', 'genemu_jqueryautocomplete_entity', array(
            'class' => 'MyBundle\Entity\MyEntity',
            'property' => 'name',
        ))
        // Suggestions with doctrine odm
        ->add('soccer_player', 'genemu_jqueryautocomplete_document', array(
            'class' => 'MyBundle\Document\MyDocument',
            'property' => 'name',
        ));
}

Extra

Ajax Suggestions

Jump to Line
Something went wrong with that request. Please try again.