2017 © Pedro Peláez
 

library typeaheadjs-bundle

Typeahead-js integration in Symfony form type

image

mapado/typeaheadjs-bundle

Typeahead-js integration in Symfony form type

  • Tuesday, October 4, 2016
  • by jdeniau
  • Repository
  • 11 Watchers
  • 0 Stars
  • 3,138 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 8 % Grown

The README.md

typeahead-js bundle

This bundle provide typeahead.js form type integration into a Symfony project., (*1)

Instalation

Install with composer:, (*2)

$ composer require mapado/typeaheadjs-bundle

Update your app/AppKernel.php file:, (*3)

$bundles = array(
    // ...
    new Mapado\TypeaheadJsBundle\MapadoTypeaheadJsBundle(),
);

Update your app/config/config.yml file to provide twig form template:, (*4)

twig:
    form:
        resources:
            - 'MapadoTypeaheadJsBundle:Form:fields.html.twig'

Use your assets manager to include this file: Resources/public/js/typeahead-form.js, (*5)

Usage

Usage is very simple:, (*6)

$builder->add('user', 'typeahead', [ 'url' => $searchUrl ]);

You need to pass the $searchUrl as a parameter., (*7)

Ajax response

The response must be a JSON array in the following format:, (*8)

[
    { "id": 1, "value": "Foo" },
    { "id": 2, "value": "Bar" }
]

Note

This bundle is greatly inspired by Lifo101 typeahead bundle but it does work with the typeahead-js new version of typeahead., (*9)

It does not requires bootstrap, and supports a lot less features for now., (*10)

Feel free to make a PR or open an issue if you want to add stuff., (*11)

The Versions

04/10 2016

dev-master

9999999-dev

Typeahead-js integration in Symfony form type

  Sources   Download

GPL-2.0

The Requires

 

16/02 2015

v1.0.1

1.0.1.0

Typeahead-js integration in Symfony form type

  Sources   Download

GPL-2.0

The Requires

 

16/02 2015

v1.0.0

1.0.0.0

Typeahead-js integration in Symfony form type

  Sources   Download

GPL-2.0

The Requires