2017 © Pedro Peláez
 

library backend

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

image

px/backend

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

  • Monday, May 16, 2016
  • by marouamech
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Backend

❮ NOTE ❯ This bundle require EasyAdminBundle. Start with reading the the documentation of [EasyAdmin] (https://github.com/javiereguiluz/EasyAdminBundle) to learn how to create complex backends., (*1)

Installation pxBackendBundle

Step 1: Download the Bundle

In your composer.json add the following code:, (*2)

"px/backend": "dev-master"

Then, (*3)

$ composer update

This command requires you to have Composer installed globally, as explained in the Composer documentation., (*4)

Step 2: Enable the Bundle

<?php
// app/AppKernel.php

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

    // ...
}

Step 3: Load the Routes of the Bundle

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

easy_admin_bundle:
    resource: "@EasyAdminBundle/Controller/"
    type:     annotation
    prefix:   /admin


# ...

Step 4: Prepare the Web Assets of the Bundle

# Symfony 2
php app/console assets:install 

# Symfony 3
php bin/console assets:install

That's it! Now everything is ready to create your first admin backend., (*5)

Your First Backend

Creating your first backend will take you less than 30 seconds. Let's suppose that your Symfony application defines one Doctrine ORM entity called Ticket., (*6)

Open the app/config/config.yml file and add the following configuration:, (*7)

# app/config/config.yml
imports:
    - { resource: @pxBackendBundle/Resources/config/config.yml }

Open the px/BackendBundle/Resources/config/config.yml file and add the following configuration:, (*8)

# px/BackendBundle/Resources/config/config.yml
imports:
    - { resource: admin.yml }
easy_admin:
    entities:
        Ticket:
            templates:
                flash_messages: "pxBackendBundle:Default:flash_messages.html.twig"
                layout: "pxBackendBundle:Default:layout.html.twig"
            class: AppBundle\Entity\Ticket

Open the px/BackendBundle/Resources/config/admin.yml file and add the following configuration:, (*9)

# px/BackendBundle/Resources/config/admin.yml
parameters:
    Ticket:
        entity_path: AppBundle\Entity\Ticket
        entity_name: AppBundle:Ticket
        table_id: dt_admin_table
        main_alias: d
        fields:
            0:
                name: id
                label: Id
                tabSortable: true
                tabVisible: true
                tabSearchable: true
                sClass: " center col-sm-2 col-md-2"

            1:
                name: actions
                label: Actions
                tabSortable: false
                tabVisible: true
                tabSearchable: false
                sClass: "col-sm-2 col-md-2 table-action center"
        default_order: 
            name: id
            index: 0
            sens: asc

Open the Repository/TicketRepository file and add the following code:, (*10)

<?php
//...
use px\BackendBundle\Repository\AdminRepository as AdminRepository;

/**
 * TicketRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class TicketRepository  extends AdminRepository {

}

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

Keep reading the rest of the documentation of [EasyAdmin] (https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/getting-started.md) to learn how to create complex backends., (*12)

License

This software is published under the MIT License, (*13)

The Versions

16/05 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

by Maroua Mechmech

crud datatable