Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

Latest commit

 

History

History
41 lines (35 loc) · 992 Bytes

File metadata and controls

41 lines (35 loc) · 992 Bytes

Use JQueryAutocomplete to suggest values on a text field

Minimal configuration:

# app/config/config.yml
sh_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