opifer/crud-bundle

此包已被弃用且不再维护。作者建议使用 apy/datagrid-bundle 包。

Opifer CRUD Bundle

安装数: 6,091

依赖: 0

推荐者: 0

安全: 0

星标: 2

关注者: 9

分支: 3

开放问题: 2

类型:symfony-bundle

0.1.1 2015-08-06 14:17 UTC

This package is auto-updated.

Last update: 2022-02-01 12:39:43 UTC


README

注意:此包不再维护。请查看 https://github.com/Abhoryo/APYDataGridBundle

Build Status SensioLabsInsight

CrudBundle

此包仍在开发中,因此直到第一个稳定版本发布之前都可能发生向后不兼容的更改。

安装

将包添加到 composer.json

composer require opifer/crud-bundle dev-master

app/AppKernel.php 中注册必要的包

public function registerBundles()
{
    // @todo reduce dependencies
    $bundles = array(
        ...
        new Braincrafted\Bundle\BootstrapBundle\BraincraftedBootstrapBundle(),
        new Genemu\Bundle\FormBundle\GenemuFormBundle(),
        new JMS\SerializerBundle\JMSSerializerBundle(),
        new Liuggio\ExcelBundle\LiuggioExcelBundle(),
        new Opifer\CrudBundle\OpiferCrudBundle(),
        new Opifer\RulesEngineBundle\OpiferRulesEngineBundle(),
        new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
        ...
    }
}

使用动态 CRUD 路由和视图

此包包含两个自定义路由器。要注册它们,将它们添加到 CmfRoutingBundle 配置中。

cmf_routing:
    chain:
        routers_by_id:
            router.default: 100
            opifer.crud.crud_router: 50
            opifer.crud.api_router: 40

更新配置文件 app/config/config.yml

opifer_crud:
    # Define a route prefix if necessary
    # Defaults to '/'
    route_prefix: /admin

    # Note: Changing the key values will break the routes pointing to that entity.
    # Make sure to fix wherever you point to that route.
    routes:
        # The key is the route part, the value is the related entity.
        users:  Acme\DemoBundle\Entity\User

定义路由后,您可以通过以下 URL 访问 CRUD 页面:

文档

文档