itscaro / crud-generator-bundle
此包生成优秀的 CRUD
0.1.5
2015-07-24 13:28 UTC
Requires
- php: ~5.4
- doctrine/orm: ~2.2,>=2.2.3
- knplabs/knp-paginator-bundle: ~2.3
- lexik/form-filter-bundle: ~3.0
- sensio/generator-bundle: ~2.5
- symfony/symfony: ~2.5
Requires (Dev)
- phpunit/phpunit: ~4.7
This package is not auto-updated.
Last update: 2024-09-28 18:15:56 UTC
README
此 Symfony2 包扩展了 [SensioGeneratorBundle] (https://github.com/sensio/SensioGeneratorBundle),它创建了一个带有分页、筛选、翻译和 Twitter Bootstrap 3 功能的优秀 CRUD。
此包基于 Jordi Llonch 制作的 [CrudGeneratorBundle] (https://github.com/jordillonch/CrudGeneratorBundle)。
截图
为什么使用 CRUD 生成器?
因为 CRUD 生成器创建简单的代码,没有魔法,没有配置文件,只是简单直接的代码,您可以轻松扩展和修改。
安装
将以下行添加到您的 composer.json
文件中
"require": {
"itscaro/crud-generator-bundle": "dev-master"
},
执行
php composer.phar update
将其添加到 AppKernel.php
类中
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
new Itscaro\CrudGeneratorBundle\ItscaroCrudGeneratorBundle(),
将其添加到您的 app/config/config.yml
framework:
translator: { fallback: en }
twig:
form:
resources:
- LexikFormFilterBundle:Form:form_div_layout.html.twig
此包适用于 Symfony >= 2.5 版本。
依赖关系
此包扩展了 SensioGeneratorBundle 并添加了
- 使用 KnpPaginatorBundle 的分页器
- 使用 LexikFormFilterBundle 的筛选支持
用法
从控制台使用以下命令
app/console itscaro:generate:crud
或为包中的所有实体生成
app/console itscaro:generate:all BUNDLE_NAME
翻译
将您的翻译放在
- BUNDLE_DIR/Resources/translations/ItscaroCrudGeneratorBundle..yml
- ROOT_DIR/app/Resources/translations/ItscaroCrudGeneratorBundle..yml
使用您自己的模板
您可以将您自己的模板放在
- BUNDLE_DIR/Resources/ItscaroCrudGeneratorBundle/skeleton
- ROOT_DIR/app/Resources/ItscaroCrudGeneratorBundle/skeleton
致谢
Jordi Llonch
许可证
CrudGeneratorBundle 在 MIT 许可证下发布。有关详细信息,请参阅 LICENSE 文件。