定制 pirasterize/sonata-form-builder 二次开发

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

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

pirasterize/sonata-form-builder

Composer 安装命令:

composer require pirasterize/sonata-form-builder

包简介

A drag&drop form builder for sonata admin

README 文档

README

A Drag & Drop Form builder inspired from the Git package https://github.com/minikomi/Bootstrap-Form-Builder and adapted for Sonata-Admin with bootstrap v3 and Jquery

You need Bootstrap v3 and Jquery on your Javascript/CSS requirements and a recent Sonata Admin installation.

Screenshot

##Install the bundle

###Step 1: Download the bundle

You can download and put on your /src directory (like this src/Pirastru/FormBuilderBundle) or insert on your vendor directory with the follow command :

 php -dmemory_limit=1G ./composer.phar require  pirasterize/sonata-form-builder

If you have a >minimum-stability< error is because your symfony installation accept only stable packages. Edit composer.json file and change "minimum-stability" from "stable" to "dev" :

    ...
    "minimum-stability": "dev",
    ...

###Step 2: Enable the bundle

Insert the follow line on your AppKernel.php in your symfony :

    class AppKernel extends Kernel
    {
        public function registerBundles()
        {
            $bundles = array(
                // ...

                 new Gregwar\CaptchaBundle\GregwarCaptchaBundle(),
                 new Pirastru\FormBuilderBundle\PirastruFormBuilderBundle()
            );

            // ...
        }

        // ...
    }

###Step 3: Configuration

Add the following configuration to your app/config/config.yml:

    gregwar_captcha: ~

Add the following configuration to your app/config/parameters.yml:

    formbuilder_email_from: jeanmichel@basquiat.com

###Step 4: Setup the database schema

    $php app/console doctrine:schema:update --force

###Step 5: Setup the routing

Append the following code to app/config/routing.yml or better to separate app/config/routing_admin.yml :

sonata_form_builder:
    resource: '@PirastruFormBuilderBundle/Controller/FormBuilderController.php'
    type:     annotation

###Step 6: Sonata admin setup

In order to have on your list of Admin entities the Form Builder you must put on your configuration file (this case app/config/sonata/sonata_admin.yml), inside of the directive of 'sonata_admin' the follow code :

sonata_admin:
    ....
    dashboard:
        ....
        groups:
            ...
            sonata.admin.group.formbuilder:
                label: Form Builder
                items:
                    - pirastru_form_builder.admin

###Step 7: Sonata blocks setup

In order to have on the list of blocks the Form Builder Block available on a page put on your configuration file (app/config/sonata/sonata_block.yml) the follow line :

sonata_block:
    ....
    blocks:
        ....
        pirastru_form_builder.block:

###Step 8: Install assets

Run the follow command on your console to install assets :

    $php app/console  assets:install

##To see the result

Check on your Sonata Admin Entities you should see the 'Form Builder' Menu than create a new drag&drop form. After that create a page from sonata page or edit an existing one and put from the list of available blocks the block called "Form Builder Drag&Drop". On Options choose the Form you just created, and take a look on the page.

##Building the bootstrap form builder Install RequireJS

npm install -g requirejs

And run following command in directory Resources/public/BootstrapFormBuilder:

r.js -o assets/js/lib/build.js

##Todo

  • Fields in differents sizes
  • Translations
  • tests
  • remove form fields that are not needed in export - Button/Captcha/Privacycheck

pirasterize/sonata-form-builder 适用场景与选型建议

pirasterize/sonata-form-builder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.93k 次下载、GitHub Stars 达 18, 最近一次更新时间为 2014 年 12 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 pirasterize/sonata-form-builder 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 2.93k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 19
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 18
  • Watchers: 3
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-05