2017 © Pedro Peláez
 

symfony-bundle admin-bundle

Simple, powerful and extendable admin bundle.

image

elao/admin-bundle

Simple, powerful and extendable admin bundle.

  • Sunday, February 5, 2017
  • by Elao
  • Repository
  • 16 Watchers
  • 9 Stars
  • 489 Installations
  • PHP
  • 2 Dependents
  • 2 Suggesters
  • 1 Forks
  • 6 Open issues
  • 17 Versions
  • 1 % Grown

The README.md

Elao Admin Bundle

Write your controller once, use it for all your models., (*1)

What?

The AdminBundle helps you define reusable Actions that can be defined as route controllers for any model., (*2)

Why?

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

How?

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

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., (*5)

Design goals

The AdminBundle is meant to improve your productivity and remain flexible and extendable., (*6)

Installation

Require the bundle in Composer:, (*7)

$ composer require elao/admin-bundle

Install the bundle in your AppKernel:, (*8)

<?php
// app/AppKernel.php

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

Import the rounting in your routing.yml configuration file:, (*9)

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

Usage

Use a set of Actions:, (*10)

  • 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!, (*11)

Configuration

Configure some actions in your config.yml:, (*12)

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

Here's an example with some action provided by the ElaoHtmlActionBundle., (*13)

# app/config/config.yml
elao_admin:
    administrations:
        post: # The name of the administration (usualy, the model name)
            repository: app.repository.post # The repository to use to access the model
            actions:
                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:, (*14)

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:, (*15)

bin/console debug:config ElaoAdminBundle

The Versions

05/02 2017

dev-master

9999999-dev https://github.com/Elao/ElaoAdminBundle

Simple, powerful and extendable admin bundle.

  Sources   Download

MIT

The Requires

 

crud admin elao

05/02 2017

v1.1.0

1.1.0.0 https://github.com/Elao/ElaoAdminBundle

Simple, powerful and extendable admin bundle.

  Sources   Download

MIT

The Requires

 

crud admin elao

16/12 2016

dev-fix-parameter

dev-fix-parameter https://github.com/Elao/ElaoAdminBundle

Simple, powerful and extendable admin bundle.

  Sources   Download

MIT

The Requires

 

crud admin elao

25/11 2016

v1.0.1

1.0.1.0 https://github.com/Elao/ElaoAdminBundle

Simple, powerful and extendable admin bundle.

  Sources   Download

MIT

The Requires

 

crud admin elao

08/11 2016

v1.0.0

1.0.0.0 https://github.com/Elao/ElaoAdminBundle

Simple, powerful and extendable admin bundle.

  Sources   Download

MIT

The Requires

 

crud admin elao

23/02 2015

0.3.x-dev

0.3.9999999.9999999-dev https://github.com/Elao/ElaoAdminBundle

Simple, powerful and extendable admin bundle.

  Sources   Download

MIT

The Requires

 

crud admin elao

18/02 2015

0.2.x-dev

0.2.9999999.9999999-dev https://github.com/Elao/ElaoAdminBundle

Simple, powerful and extendable admin bundle.

  Sources   Download

MIT

The Requires

 

crud admin elao

06/02 2015

dev-delete-form-validation-disabled

dev-delete-form-validation-disabled https://github.com/Elao/ElaoAdminBundle

Simple, powerful and extendable admin bundle.

  Sources   Download

MIT

The Requires

 

crud admin elao

06/11 2014
15/10 2014

v0.1

0.1.0.0 https://github.com/Elao/ElaoAdminBundle

Simple, powerful and extendable admin bundle.

  Sources   Download

MIT

The Requires

 

crud admin elao