定制 petkopara/crud-generator-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

petkopara/crud-generator-bundle

Composer 安装命令:

composer require petkopara/crud-generator-bundle

包简介

Symfony3 bundle for CRUD generation with pagination, filtering, sorting, page size, bulk delete and bootstrap3 markup. This Generator supports Doctrine association mapping.

README 文档

README

Symfony3 CRUD generator bundle with pagination, filtering, Twitter bootstrap 3.3.6 markup and many other features. It's Simple to use and fully customizable.

Designed to bring back the functionality of the old Symfony 1.4 admin generator, but extending from SensioGeneratorBundle with additional options and features.

Build Status SensioLabsInsight Latest Stable Code Coverage Scrutinizer Code Quality Total Downloads

Features

  • Pagination - using PagerFanta
  • Filtering (With single multi search input or form)
  • Doctrine association mapping support for Many-to-One, One-to-One and Many-to-Many (if the relation is the owning side) in forms and filters
  • Sorting
  • Items per page
  • Bulk actions(delete) on multiple rows
  • Delete from index
  • Set your base template in the generated views.
  • Possibility to set the save path for all the generated files (by default in app/Resources).
  • Possiblity to not generate show code.
  • Most of the features are optional and you can generate the CRUD very flexible depending on your needs.

Screenshots

Multi Search Filter

Screenshot

Form Filter

Screenshot

Installation

This bundle is compatible with Symfony 2.8/3.0 or higher.

Using composer

Symfony >= 2.8

composer require petkopara/crud-generator-bundle

Register the CRUD and filter bundles in your AppKernel.php:

new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
new Petkopara\MultiSearchBundle\PetkoparaMultiSearchBundle(),
new Petkopara\CrudGeneratorBundle\PetkoparaCrudGeneratorBundle(),

Install the assets.

php bin/console assets:install --symlink

For the bootstrap theme of the forms, add this to your app/config/config.yml

twig:
    form_themes:
	- 'bootstrap_3_layout.html.twig' 

Optionally if you are using your own base template, be sure that you include the javascript file of the bundle in it.

<script src="{{ asset('bundles/petkoparacrudgenerator/js/petkopara-crud-generator.js') }}"></script>

Dependencies

This bundle extends SensioGeneratorBundle. Pagination with PagerFanta . For the filtering is used PetkoparaMutiSearchBundle and LexikFormFilterBundle.

Usage

Use the following command from console:

php bin/console petkopara:generate:crud

And follow the wizard steps.

Available new options

The default behavior of the bundle is to generate full featured crud, but you can customize what to be generated or not. The bundle adds few new parameters compared to the doctrine crud generator, to control all of the new features.

  • --filter-type - Which filter type to use. There is three options:

    • input - To use Multi Search input.
    • form - To use Lexik form filter.
    • none - Will not generate any filter code.
  • --template - The base template name, which the views will override. For example set it to --template=base.html.twig to extends your base template.(by default PetkoparaCrudGeneratorBundle::base.html.twig).

  • --without-write - The default behavior of the bundle is to generate write code, so for that --with-write option is transformed to this.

  • --without-show - Many times you don't need show code, for that this option is introduced.

  • --without-sorting - To not generate sorting code.

  • --without-page-size - To not generate items per page code.

  • --without-bulk - To not generate bulk actions code.

  • --bundle-views - Whether to store the view files in the bundles dir. By default the vies are stored in app/Resources/views/ .

Don't forget, that this is a just crud generator and you are free to change everything generated from this bundle.

Templates

Every generated file is based on a template. There are default templates but they can be overridden by placing custom templates in one of the following locations, by order of priority:

BUNDLE_PATH/Resources/PetkoparaCrudGeneratorBundle/skeleton/crud
APP_PATH/Resources/PetkoparaCrudGeneratorBundle/skeleton/crud

And

BUNDLE_PATH/Resources/PetkoparaCrudGeneratorBundle/skeleton/form
APP_PATH/Resources/PetkoparaCrudGeneratorBundle/skeleton/form

Author

Petko Petkov - petkopara at gmail dot com

License

CrudGeneratorBundle is licensed under the MIT License.

petkopara/crud-generator-bundle 适用场景与选型建议

petkopara/crud-generator-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 58.16k 次下载、GitHub Stars 达 70, 最近一次更新时间为 2016 年 11 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「generator」 「pagination」 「doctrine」 「filter」 「crud」 「sorting」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 petkopara/crud-generator-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 petkopara/crud-generator-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 petkopara/crud-generator-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 58.16k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 72
  • 点击次数: 28
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 70
  • Watchers: 12
  • Forks: 17
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-03