Skip to content

Latest commit

 

History

History
106 lines (71 loc) · 3.23 KB

installation-via-composer.md

File metadata and controls

106 lines (71 loc) · 3.23 KB

Installation via composer


go back to Table of contents

1. Download files

1.1 Add dependencies

1.1.1 Use branch 1.0 for Twitter bootstrap 2.X version

composer require cedriclombardot/admingenerator-generator-bundle:~1.0

1.1.1 Use branch 1.1 for Twitter bootstrap 3.X version

composer require cedriclombardot/admingenerator-generator-bundle:~1.1

1.2 Configure componets directory

Edit your composer.json config and add:

"config": {
    "component-dir": "web/components" 
},

1.3 Update dependencies

Then run composer update command.

Note: If you're getting no matching package found error then you must also add "minimum-stability": "dev" to your composer.json file.

2. Enable bundles

Admingenerator has a dependency on KnpMenuBundle and WhiteOctroberPagerfantaBundle.

Note: there are also some optional dependencies, each is described in corresponding feature`s doc. This guide describes only the minimal-setup.

Enable Admingenerator and its dependencies in your app/AppKernel.php:

<?php 
public function registerBundles()
{
    $bundles = array(
        // ...
        new Admingenerator\GeneratorBundle\AdmingeneratorGeneratorBundle(),
        new Knp\Bundle\MenuBundle\KnpMenuBundle(),
        new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
    );
}

3. Basic configuration

Choose your model manager and choose basic admingenerator template - with or without assetic. -- add following lines to app/config/config.yml:

admingenerator_generator:
    # choose  and enable at least one
    use_propel:           true
    use_doctrine_orm:     true
    use_doctrine_odm:     false
    
    # choose and uncomment only one
#    base_admin_template: AdmingeneratorGeneratorBundle::base_admin.html.twig
#    base_admin_template: AdmingeneratorGeneratorBundle::base_admin_assetic_less.html.twig

(Optional) Configure Assetic & YUI comperssor

By default, the base_admin.html.twig uses YUI Compressor to minify assets and combine them into one file (less HTTP requests).

In order to properly install and configure YUI Compressor follow this article

See also Asset Management cookbook entry.

4. Install assets

To install assets in your web directory run:

php app/console assets:install web --symlink

Note: We recommend installing assets with --symlink option, however you may skip this option if you wish to hard copy assets.

(Optional) Dump assets

If you're useing assetic for asset management dump your assets by running:

php app/console assetic:dump

5. Specify routes

Dashboard route (Optional)

By default brand text ("Dashboard") is disabled. To link it with your Dashboard add dashboard_welcome_path under admingenerator_generator in your app/config/config.yml:

admingenerator_generator:
    dashboard_welcome_path:     MyDashboard_path