Code Monkey home page Code Monkey logo

admingeneratorgeneratorbundle's Introduction

Symfony2 Admin Generator: The Real Missing Admin Generator for Symfony2! project status# build status#

This package is a Symfony2 Admin Generator based on YAML configuration and Twig templating. It's inspired by fzaninotto/Doctrine2ActiveRecord.

It actually supports:

  • Doctrine ORM
  • Doctine ODM
  • Propel

With almost the same features:

  • A YAML to configure create/edit/delete/list actions
  • Manage relations one to one, one to many, many to one and many to many
  • Easy edit of forms by changing properties of fields in YAML.
  • Configure fieldsets
  • Configure more that one field per line
  • Change the database column you want to sortOn or filterOn for a field in list
  • A complete admin design
  • Translated into EN, FR, RU, PT, ES, SL, DE (you can easily contribute to add your own)
  • Filters by form & by scopes combinable
  • Credentials for actions, columns, and form fields
  • ...

This bundle in pictures

Preview of list

Preview of edit

Want another skin?

Just install ActiveAdminTheme

![Preview of ActiveAdminTheme] (https://github.com/cedriclombardot/AdmingeneratorActiveAdminThemeBundle/raw/master/Resources/doc/list-preview.png)

Want to run a test?

The fastest way to try it is to setup the AdmingeneratorIpsum project: https://github.com/cedriclombardot/AdmingeneratorIpsum. This is a complete Symfony2 application with this bundle well configured.

Installation

Install this bundle

git clone git://github.com/cedriclombardot/AdmingeneratorGeneratorBundle.git vendor/bundles/Admingenerator/GeneratorBundle

Or using deps file

[AdmingeneratorGeneratorBundle]
    git=git://github.com/cedriclombardot/AdmingeneratorGeneratorBundle.git
    target=/bundles/Admingenerator/GeneratorBundle
    version=origin/master

Register it in the autoload.php file:

<?php
// app/autoload.php

$loader->registerNamespaces(array(
    'Admingenerator'    => array(__DIR__.'/../src', __DIR__.'/../vendor/bundles'),
));

Add it to the AppKernel class:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...

        // Admin Generator
        new Admingenerator\GeneratorBundle\AdmingeneratorGeneratorBundle(),
    );

    // ...
}

Install SensioGeneratorBundle

git submodule add git://github.com/sensio/SensioGeneratorBundle.git vendor/bundles/Sensio/Bundle/GeneratorBundle

Register it in the autoload.php file:

<?php
// app/autoload.php

$loader->registerNamespaces(array(
    'Sensio\Bundle'     => __DIR__.'/../vendor/bundles',
));

Add it to the AppKernel class:

$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(),

Install KnpMenuBundle

git submodule add https://github.com/knplabs/KnpMenuBundle.git vendor/bundles/Knp/Bundle/MenuBundle
git submodule add https://github.com/knplabs/KnpMenu.git vendor/KnpMenu

or using deps file

[MenuBundle]
    git=git://github.com/knplabs/KnpMenuBundle.git
    target=/bundles/Knp/Bundle/MenuBundle

[KnpMenu]
    git=git://github.com/knplabs/KnpMenu.git
    target=/KnpMenu

Register it in the autoload.php file:

<?php
// app/autoload.php

$loader->registerNamespaces(array(
    'Knp'    	=> __DIR__.'/../vendor/bundles',
    'Knp\Menu' 	=> __DIR__.'/../vendor/KnpMenu/src'
));

Add it to the AppKernel class:

$bundles[] = new Knp\Bundle\MenuBundle\KnpMenuBundle();

Don't forget to configure it to use twig in config.yml:

knp_menu:
    twig: true

Now two ways to continue the setup:

Manually, follow the end of readme, or automatically,

php app/console admin:setup

Install TwigGenerator

git submodule add http://github.com/cedriclombardot/TwigGenerator.git vendor/twig-generator

Register it in the autoload.php file:

<?php
// app/autoload.php

$loader->registerNamespaces(array(
    'TwigGenerator'         => __DIR__.'/../vendor/twig-generator/src',
));

Install Pagerfanta

git submodule add http://github.com/whiteoctober/Pagerfanta.git vendor/pagerfanta
git submodule add http://github.com/whiteoctober/WhiteOctoberPagerfantaBundle.git vendor/bundles/WhiteOctober/PagerfantaBundle

Register it in the autoload.php file:

<?php
// app/autoload.php

$loader->registerNamespaces(array(
    'WhiteOctober\PagerfantaBundle' => __DIR__.'/../vendor/bundles',
    'Pagerfanta' 					=> __DIR__.'/../vendor/pagerfanta/src',
));

Add it to the AppKernel class:

$bundles[] = new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),

Configure JMS

In config.yml

jms_security_extra:
     expressions: true

Setup the Model Manager you want

At this step, you'll have to install the Model Manager you want (Doctrine ORM, Doctrine ODM and/or Propel). E.g. with Doctrine, you'll have to setup the Doctrine2FixtureBundle bundle.

Install Doctrine2FixtureBundle & Create the database

php app/console doctrine:database:create
php app/console doctrine:schema:create
php app/console doctrine:fixtures:load

Install Assetic (Optionnal see without assetic part)

git submodule add git://github.com/symfony/AsseticBundle.git vendor/bundles/Symfony/Bundle/AsseticBundle
git submodule add git://github.com/kriswallsmith/assetic.git vendor/assetic

Register it in the autoload.php file:

<?php
// app/autoload.php

$loader->registerNamespaces(array(
    'Assetic'           => __DIR__.'/../vendor/assetic/src',
));

Add it to the AppKernel class:

$bundles[] = new Symfony\Bundle\AsseticBundle\AsseticBundle(),

Configure the routing in app/config/routing.yml:

_assetic:
    resource: .
    type: assetic

To run assets you also need to install sass & compass:

sudo gem install compass # https://github.com/chriseppstein/compass
sudo gem install sass

Configure Assetic:

assetic:
    filters:
        cssrewrite: ~
        sass:
            bin: /var/lib/gems/1.8/gems/sass-3.1.7/bin/sass
            compass: /var/lib/gems/1.8/gems/compass-0.11.5/bin/compass

Without Assetic

Configure your config.yml to use the assetic less template

admingenerator_generator:
    base_admin_template: AdmingeneratorGeneratorBundle::base_admin_assetic_less.html.twig
admingenerator_user:
    login_template: AdmingeneratorGeneratorBundle::base_login_assetic_less.html.twig

With or without assetic

Publish assets:

php app/console assets:install web/

Last step

Configure the dev environment:

admingenerator_generator:
    overwrite_if_exists: true

And of course for prod:

php app/console -env prod cache:warmup

Need support?

https://groups.google.com/group/symfony2admingenerator

Sensio Connect

https://connect.sensiolabs.com/club/symfony2admingenerator


Note: The admin theme is from https://github.com/martinrusev/admin-theme

admingeneratorgeneratorbundle's People

Contributors

ajessu avatar cbou avatar cedriclombardot avatar damienalexandre avatar datiecher avatar daum avatar fabienpomerol avatar jaugustin avatar laurentb avatar leek avatar mazenovi avatar seldaek avatar szappacosta avatar uavn avatar willdurand avatar wwwdata avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.