dev-master
9999999-devpxBackendBundle lets you create administration backends for Symfony applications with unprecedented simplicity.
MIT
The Requires
- php >=5.3.0
- javiereguiluz/easyadmin-bundle v1.12.7
by Maroua Mechmech
crud datatable
Wallogit.com
2017 © Pedro Peláez
pxBackendBundle lets you create administration backends for Symfony applications with unprecedented simplicity.
❮ 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)
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)
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new JavierEguiluz\Bundle\EasyAdminBundle\EasyAdminBundle(),
new px\BackendBundle\pxBackendBundle(),
);
}
// ...
}
# app/config/routing.yml
px_backend:
resource: "@pxBackendBundle/Controller/"
type: annotation
prefix: /admin
easy_admin_bundle:
resource: "@EasyAdminBundle/Controller/"
type: annotation
prefix: /admin
# ...
# 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)
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)
This software is published under the MIT License, (*13)
pxBackendBundle lets you create administration backends for Symfony applications with unprecedented simplicity.
MIT
crud datatable