snide / extra-form-bundle
额外的表单类型包
dev-master
2017-04-20 14:41 UTC
This package is not auto-updated.
Last update: 2024-09-14 14:34:46 UTC
README
为 symfony 2 提供额外的表单类型
特性
- 基于 jQuery multiselect2side 插件的双向列表类型
安装
通过 Composer 安装
如果你使用 composer,请将 ExtraFormBundle 包作为依赖项添加到你的应用 composer.json 文件中
"require": { ... "snide/extra-form-bundle": "dev-master" ... },
将 SnideExtraFormBundle 添加到你的应用内核。
// app/AppKernel.php <?php // ... public function registerBundles() { $bundles = array( // ... new Snide\Bundle\ExtraFormBundle\SnideExtraFormBundle(), ); }
此包需要将必要的资源复制到 web 文件夹。你可以使用以下命令:
php app/console assets:install
模板中包含
此包包含一个 Twig 扩展。要初始化 CSS 脚本,使用这可以使仅在需要时将额外的表单 JavaScript 和 CSS 包含到你的页面中变得非常简单。它将输出完整的 JavaScript,包括 <script>
标签,并添加样式表。将其添加到页面的底部。
{{ snide_extra_form_init() }}
基本配置
snide_extra_form: include_jquery: true
选项 include_jquery
允许你从 Google CDN 加载外部 jQuery 库。如果你还没有在页面上包含 jQuery,请将其设置为 true
。