Simple, powerful and extendable admin bundle.

Installs: 537

Dependents: 2

Suggesters: 2

Stars: 9

Watchers: 17

Forks: 1

Open Issues: 6


v1.1.0 2017-02-05 11:48 UTC


Write your controller once, use it for all your models.


The AdminBundle helps you define reusable Actions that can be defined as route controllers for any model.


The AdminBundle improves your productivity when implementing similar controller behavior for several models, such as CRUD back-end.


The AdminBundle declares Actions as abstract services, instanciates and configures one instance for each model and register the corresponding route in the Symfony router.

You just need to say "I want a list of user." and the AdminBundle register a /users route that run a ListAction instance configured to handle the User model.

Design goals

The AdminBundle is meant to improve your productivity and remain flexible and extendable.


Require the bundle in Composer:

$ composer require elao/admin-bundle

Install the bundle in your AppKernel:

// app/AppKernel.php

public function registerBundles()
    $bundles = [
        // ...
        new Elao\Bundle\AdminBundle\ElaoAdminBundle(),

Import the rounting in your routing.yml configuration file:

// app/config/routing.yml
    resource: "@ElaoAdminBundle/Resources/config/routing.yml"
    prefix:   / # You can prefix all actions here


Use a set of Actions:

  • HTML Actions: For easily performing CRUD operations using Symfony forms.
  • REST Actions: For building an Api through REST actions.

Or create your own set of actions!


Configure some actions in your config.yml:

# app/config/config.yml
        # Where 'name' is the name of the administration
            # Administration-level options (optional)
            foo: true
            # (required)
                # Where 'alias' is the alias of the action
                    # Where 'action_type' is a registered action type.
                        # Every action has its own options

Here's an example with some action provided by the ElaoHtmlActionBundle.

# app/config/config.yml
        post: # The name of the administration (usualy, the model name)
            repository: app.repository.post # The repository to use to access the model
                list:               # A "list" action,
                    html_list: ~    # that use default configuration for "html_list".

                create:             # A "create" action,
                    html_create:    # that use "html_create" and specify the form to use.
                        form: BlogBundle\Form\PostType

                update:             # A "update" action,
                    html_update:    # that use "html_update" and specify the form to use.
                        form: BlogBundle\Form\PostType

                read:               # A "read" action,
                    html_read: ~    # that use default configuration for "html_read".

                delete:             # A "delete" action,
                    html_delete:    # that use "html_delete" and adds a security restriction.
                        security: has_role('ROLE_ADMIN')

This config will generate the following routes:

Name Method Scheme Host Path
post_list GET ANY ANY /posts
post_create GET/POST ANY ANY /posts/new
post_update GET/POST ANY ANY /posts/{id}/edit
post_read GET ANY ANY /posts/{id}
post_delete GET/POST ANY ANY /posts/{id}/delete

Configuration detail

To get the full detail and default values for yout administration just run:

bin/console debug:config ElaoAdminBundle