mapado/typeaheadjs-bundle
最新稳定版本:v1.0.1
Composer 安装命令:
composer require mapado/typeaheadjs-bundle
包简介
Typeahead-js integration in Symfony form type
README 文档
README
This bundle provide typeahead.js form type integration into a Symfony project.
Instalation
Install with composer:
$ composer require mapado/typeaheadjs-bundle
Update your app/AppKernel.php file:
$bundles = array( // ... new Mapado\TypeaheadJsBundle\MapadoTypeaheadJsBundle(), );
Update your app/config/config.yml file to provide twig form template:
twig: form: resources: - 'MapadoTypeaheadJsBundle:Form:fields.html.twig'
Use your assets manager to include this file: Resources/public/js/typeahead-form.js
Usage
Usage is very simple:
$builder->add('user', 'typeahead', [ 'url' => $searchUrl ]);
You need to pass the $searchUrl as a parameter.
Ajax response
The response must be a JSON array in the following format:
[
{ "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.
It does not requires bootstrap, and supports a lot less features for now.
Feel free to make a PR or open an issue if you want to add stuff.
统计信息
- 总下载量: 3.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2015-02-16