定制 jd/draggy 二次开发

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

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

jd/draggy

最新稳定版本:v1.0

Composer 安装命令:

composer require jd/draggy

包简介

Draggy - Visual code development tool and template engine

README 文档

README

Draggy is a code development tool and template engine that enables the user to create and maintain a functional Skeleton of an application.

The installation instructions here are for installing Draggy as a vendor on an existing Symfony2 installation. If you are starting a new project, there is an easier way to get started by downloading a Symfony2 installation that already has Draggy bundled. For details please go to https://github.com/j-d/symfony-standard-draggy

Downloading that bundle package is the same as creating a new Symfony2 project and following the steps below.

If you want to see a demo, you can download one from here: https://github.com/j-d/draggy-demo

Installation (as a vendor on an existing Symfony2 installation)

Edit your composer.json file and add draggy as a dependency

sudo nano composer.json
    "require-dev": {
        ...
        "jd/draggy": "dev-master"
        ...

Change the version of the Incenteev dependency as it doesn't currently (2.3) support additional parameters on the parameters.yml file:

    "require": {
        ...
        "incenteev/composer-parameter-handler": "2.1.*@dev"
        ...

Run composer update to download the recently added dependency

sudo composer update

Copy the parameters_draggy.yml.dist file from vendor/jd/draggy/app/config/ to app/config/ as parameters_draggy.yml

sudo cp vendor/jd/draggy/app/config/parameters_draggy.yml.dist app/config/parameters_draggy.yml

Edit your parameters.yml file to add an import of the parameters_draggy.yml file

sudo nano app/config/parameters.yml
    imports:
        - { resource: parameters_draggy.yml }
        ...
    
    parameters:
    ...

Edit the parameters_draggy.yml and configure the model file name and other parameters

sudo nano app/config/parameters_draggy.yml
parameters:
    draggy.model_filename:      <your_model_name>.xml
    draggy.model_path:          %kernel.root_dir%/../doc/
    draggy.model_history_path:  %kernel.root_dir%/../doc/history/
    draggy.model_xml_extension: .xml
    draggy.autocode.src_path:   %kernel.root_dir%/../src/

Create the folder where you are going to save the model, if it doesn't exist

mkdir doc

Crate the path where you are going to save the model history, if it doesn't exist

mkdir doc/history

Give write access to www-data to those folder

sudo apt-get install acl

sudo setfacl -R  -m u:www-data:rwx -m u:`whoami`:rwx doc doc/history
sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx doc doc/history

Add doc/history to the .gitignore

sudo nano .gitignore
...
/doc/history/*
!.gitkeep

Register the DraggyBundle in the app\AppKernel.php (it is recommended to add it on the dev section)

sudo nano app/AppKernel.php
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    ...
    $bundles[] = new Draggy\Bundle\DraggyBundle\DraggyBundle();
    $bundles[] = new Draggy\Bundle\MockBundle\MockBundle();
    ...

Modify the routing_dev.yml file to add Draggy routes

sudo nano app/config/routing_dev.yml
... 
_draggy:
    resource: "@DraggyBundle/Resources/config/routing.yml"
    prefix:   /_draggy/

If you are going to use the default Draggy mock templates, copy the custom form_div_layout.html.twig into the resources folder:

mkdir app/Resources/views/Form
cp vendor/jd/draggy/src/Draggy/Bundle/MockBundle/Resources/views/Form/form_div_layout.html.twig app/Resources/views/Form/form_div_layout.html.twig

and amend your config.yml file to use this twig template and add the MockBundle to assetic:

sudo nano app/config/config.yml
... 
twig:
    ...
    form:
        resources:
            - ':Form:form_div_layout.html.twig'
...
assetic:
    ...
    bundles:        [MockBundle]
    ...

Install the Draggy assets

sudo php app/console assets:install --symlink

That's it! To use it just browse to the path you created, e.g. http://myproject.local/app_dev.php/_draggy

Happy Draggy-ing!

jd/draggy 适用场景与选型建议

jd/draggy 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 377 次下载、GitHub Stars 达 2, 最近一次更新时间为 2013 年 02 月 20 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 jd/draggy 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 377
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 16
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-02-20