Skip to content

Providing dynamic CRUD functionality to your Symfony2 project

License

Notifications You must be signed in to change notification settings

Supersander/CrudBundle

 
 

Repository files navigation

Build Status SensioLabsInsight

CrudBundle

This bundle is still very much a work in progress, so BC-breaks will happen until the first stable release.

Installation

Add the bundle to your composer.json

composer require opifer/crud-bundle dev-master

Register the necessary bundles in 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 Opifer\CrudBundle\OpiferCrudBundle(),
        new Opifer\RulesEngineBundle\OpiferRulesEngineBundle(),
        new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
        ...
    }
}

Using dynamic crud routing & views

This bundle ships with two custom routers. To register them, add them to the CmfRoutingBundle config.

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

Update your config file 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

After defining a route, you can visit the CRUD pages at the following URL's:

Documentation

Documentation

About

Providing dynamic CRUD functionality to your Symfony2 project

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 82.0%
  • HTML 14.8%
  • JavaScript 2.9%
  • CSS 0.3%