Developed with love by KnpLabs Hire us for your project!
579

EasyAdminBundle

by javiereguiluz

The new (and simple) admin generator for Symfony applications.

❮ NOTE ❯ This bundle releases new versions on a regular basis. Make sure
to update your dependencies frequently to get the latest version.
Check out the changelog
to learn about the new features.


EasyAdmin

Build Status
SensioLabsInsight

EasyAdmin lets you create administration backends for Symfony applications
with unprecedented simplicity.

Features

  • CRUD operations on Doctrine entities (create, edit, list, delete).
  • Full-text search, pagination and column sorting.
  • Fully responsive design (smartphones, tablets and desktops).
  • Translated into tens of languages.
  • Fast, simple and smart where appropriate.

Requirements

  • Symfony 2.3+ applications (Silex not supported).
  • Doctrine ORM entities (Doctrine ODM and Propel not supported).
  • Entities with simple primary keys (composite keys not supported).
  • All kinds of entity associations are supported, except many-to-many.
  • Entities using inheritance are not supported.

Installation

The EasyAdmin installation requires you to edit two files and execute two
console commands, as explained in the following steps.

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:

$ composer require javiereguiluz/easyadmin-bundle

This command requires you to have Composer installed globally, as explained
in the installation chapter
of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding the following line in the app/AppKernel.php
file of your Symfony application:

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new JavierEguiluz\Bundle\EasyAdminBundle\EasyAdminBundle(),
        );
    }

    // ...
}

Step 3: Load the Routes of the Bundle

Open your main routing configuration file (usually app/config/routing.yml)
and copy the following four lines at the very beginning of it:

# app/config/routing.yml
easy_admin_bundle:
    resource: "@EasyAdminBundle/Controller/"
    type:     annotation
    prefix:   /admin

# ...

Step 4: Prepare the Web Assets of the Bundle

This bundle includes several CSS, JavaScript and font files which are used in
the backend interface. Execute the following command to make those assets
available in your Symfony application:

php app/console assets:install --symlink

That's it! Now everything is ready to create your first admin backend.

Your First Backend

Creating your first backend will take you around 30 seconds because you just
have to create a simple configuration file.

Let's suppose that you already have defined in your Symfony application three
Doctrine ORM entities called Customer, Order and Product. Open your main
application configuration file (usually app/config/config.yml) and add the
following configuration:

# app/config/config.yml
easy_admin:
    entities:
        - AppBundle\Entity\Customer
        - AppBundle\Entity\Order
        - AppBundle\Entity\Product

Congratulations! You've just created your first fully-featured backend!
Browse the /admin URL in your Symfony application and you'll get access to
the admin backend:

Default listing interface

Creating a backend is that simple because EasyAdmin doesn't generate any code.
All resources are served on-the-fly to ensure an exceptional developer experience.

Without any further configuration, EasyAdmin guesses the best settings to make
your admin backend look "good enough". This may be acceptable for simple
backends and rapid prototypes, but most of the times, you need to customize
some parts of the backend. Keep reading the rest of the documentation to learn
how to do it.


❮ NOTE ❯ you are reading the documentation of the bundle's most recent
stable version
. You can also read the documentation of the development version ➜.


LEGAL DISCLAIMER

This software is published under the MIT License, which states that:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

The MIT License (MIT)

Copyright (c) 2015 Javier Eguiluz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

easy_admin:

# DEPRECATED: use the "actions" option of the "list" view.
list_actions: ~

# DEPRECATED: use "max_results" option under the "list" global key.
list_max_results: ~
assets:

# DEPRECATED: use the "design -> assets -> css" option.
css: []

# DEPRECATED: use the "design -> assets -> js" option.
js: []

# The name displayed as the title of the administration zone (e.g. company name, project name).
site_name: Easy Admin
formats:

# The PHP date format applied to "date" field types.
date: Y-m-d # Example: d/m/Y (see http://php.net/manual/en/function.date.php)

# The PHP time format applied to "time" field types.
time: H:i:s # Example: h:i a (see http://php.net/date)

# The PHP date/time format applied to "datetime" field types.
datetime: F j, Y H:i # Example: l, F jS Y / h:i (see http://php.net/date)

# The sprintf-compatible format applied to numeric values.
number: ~ # Example: %.2d (see http://php.net/sprintf)
design:

# The theme used to render the backend pages. For now this value can only be "default".
theme: default

# The color scheme applied to the backend design (values: "dark" or "light").
color_scheme: dark

# The color used in the backend design to highlight important elements.
brand_color: #E67E22

# The form theme applied to backend forms. Allowed values: "horizontal", "vertical" and a custom theme path or array of custom theme paths.
form_theme: Array
assets:

# The array of CSS assets to load in all backend pages.
css: []

# The array of JavaScript assets to load in all backend pages.
js: []

# The custom templates used to render each backend element.
templates:

# Used to decorate the main templates (list, edit, new and show)
layout: ~

# Used to render the page where entities are edited
edit: ~

# Used to render the listing page and the search results page
list: ~

# Used to render the page where new entities are created
new: ~

# Used to render the contents stored by a given entity
show: ~

# Used to render the form displayed in the new and edit pages
form: ~

# Used to render the paginator in the list page
paginator: ~

# Used to render array field types
field_array: ~

# Used to render fields that store Doctrine associations
field_association: ~

# Used to render bigint field types
field_bigint: ~

# Used to render boolean field types
field_boolean: ~

# Used to render date field types
field_date: ~

# Used to render datetime field types
field_datetime: ~

# Used to render datetimetz field types
field_datetimetz: ~

# Used to render decimal field types
field_decimal: ~

# Used to render float field types
field_float: ~

# Used to render the field called "id". This avoids formatting its value as any other regular number (with decimals and thousand separators)
field_id: ~

# Used to render image field types (a special type that displays the image contents)
field_image: ~

# Used to render integer field types
field_integer: ~

# Used to render simple array field types
field_simple_array: ~

# Used to render smallint field types
field_smallint: ~

# Used to render string field types
field_string: ~

# Used to render text field types
field_text: ~

# Used to render time field types
field_time: ~

# Used to render toggle field types (a special type that display booleans as flip switches)
field_toggle: ~

# Used when the field to render is an empty collection
label_empty: ~

# Used when is not possible to access the value of the field to render (there is no getter or public property)
label_inaccessible: ~

# Used when the value of the field to render is null
label_null: ~

# Used when any kind of error or exception happens when trying to access the value of the field to render
label_undefined: ~
list:

# The list of actions enabled in the "list" view.
actions: []

# The maximum number of items to show on listing and search pages.
max_results: 15
edit:

# The list of actions enabled in the "edit" view.
actions: []
new:

# The list of actions enabled in the "new" view.
actions: []
show:

# The list of actions enabled in the "show" view.
actions: []

# The list of entities to manage in the administration zone.
entities: Array
  • bug #263 Refactored the search logic to better use Doctrine expressions (javiereguiluz)
    By javiereguiluz, 1 year ago
  • bug #261 Fixed an issue with responsive tables and empty cells (javiereguiluz)
    By javiereguiluz, 1 year ago
  • Refactored the search logic to better use Doctrine expressions
    By javiereguiluz, 1 year ago
  • Fixed an issue with responsive tables and empty cells
    By javiereguiluz, 1 year ago
  • bug #259 Added some advanced tests for the new template overriding mechanism (javiereguiluz)
    By javiereguiluz, 1 year ago
  • Added some advanced tests for the new template overriding mechanism
    By javiereguiluz, 1 year ago
  • bug #256 Fixed issue in searching templates resources files (Pierstoval)
    By javiereguiluz, 1 year ago
  • Fixed issue in searching templates resources files
    By Pierstoval, 1 year ago
  • Minor tweak to the previous commits
    By javiereguiluz, 1 year ago
  • minor #255 Table header is rawable (Pierstoval)
    By javiereguiluz, 1 year ago
  • Table header is rawable
    By Pierstoval, 1 year ago
  • feature #254 Form helper becomes 'rawable' to allow html inside (Pierstoval)
    By javiereguiluz, 1 year ago
  • Form helper becomes 'rawable' to allow html inside
    By Pierstoval, 1 year ago
  • feature #251 Fixed the search form query for non-text fields (javiereguiluz)
    By javiereguiluz, 1 year ago
  • Fixed the search form query for non-text fields
    By javiereguiluz, 1 year ago
  • minor #252 Correct the link for overriding symfony controllers (skyosev)
    By javiereguiluz, 1 year ago
  • Correct the link for overriding symfony controllers
    By , 1 year ago
  • feature #244 Allow to easily customize/override any backend element (javiereguiluz)
    By javiereguiluz, 1 year ago
  • Minor tweaks for Twig blocks
    By javiereguiluz, 1 year ago
  • Added new blocks in the show.html.twig template
    By javiereguiluz, 1 year ago
  • The Twig extension no longer needs the @router services because it doesn't generate any URL
    By javiereguiluz, 1 year ago
  • Templates (and text files in general) should end with a new line character
    By javiereguiluz, 1 year ago
  • Minor fix in a comment
    By javiereguiluz, 1 year ago
  • Type hinted variables with interfaces instead of concrete implementations
    By javiereguiluz, 1 year ago
  • Improved the return type of a method description
    By javiereguiluz, 1 year ago
  • Added a lot of blocks in the list.html.twig template
    By javiereguiluz, 1 year ago
  • Added blocks in edit, form and new templates
    By javiereguiluz, 1 year ago
  • Moved the default/form/entity_form.html.twig template to default/form.html.twig
    By javiereguiluz, 1 year ago
  • Defined a lot of blocks for the layout.html.twig template
    By javiereguiluz, 1 year ago
  • Removed an unreachable code
    By javiereguiluz, 1 year ago