caxy/easy-sonata-admin

Simplified Configuration system for Sonata Admin.

Installs: 67

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 5

Forks: 0

Open Issues: 0

Type:symfony-bundle

1.0 2016-05-12 18:54 UTC

This package is not auto-updated.

Last update: 2024-04-09 20:12:57 UTC


README

###Getting Started

  1. Add EasySonataAdminBundle to your project
composer require caxy/easy-sonata-admin
  1. Enable the bundle
// app/AppKernal.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(

            //Load before SonataAdminBundle!
            new Caxy\EasySonataAdminBundle\EasySonataAdminBundle(),

            new Sonata\AdminBundle\SonataAdminBundle(),
        );
    }
}
  1. Configure your admin. Example for FOS User Entity below:
// app/config/config.yml

easy_sonata_admin:
    entities:
        User:
            class: AppBundle\Entity\User
            batch_actions:
                - '-delete'
            list:
                fields:
                    - id
                    - username
                    - email
                    - enabled
                actions: [show: {}, 'edit', 'delete']
            edit:
                fields:
                    - { property: id, type_options: { } }
                    - { property: username, type_options: { } }
                    - { property: email, type_options: { } }
                    - { property: enabled, type_options: { } }
                    - { property: 'plain_password', type: 'text', type_options: { required: true } }
                actions: ['-delete']
            filter:
                fields:
                    - username
                    - email
                    - enabled
                    - roles
            show:
                fields:
                    - username
                    - email
                    - enabled
                    - { property: 'last_login', type: 'datetime' }
                    - roles
                actions: ['-delete']