bbit/admin-bundle

symfony AdminBundle

Installs: 1 145

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Language:HTML

Type:symfony-bundle

dev-master 2017-11-14 10:44 UTC

This package is not auto-updated.

Last update: 2024-12-22 03:39:33 UTC


README

Appkernel:

new BBIT\AdminBundle\BBITAdminBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new BBIT\DataGridBundle\BBITDataGridBundle(),
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),

Create AdminClass:

class ItemAdmin extends BaseAdmin
{
    protected function listQueryBuilder() {
        $qb = parent::listQueryBuilder();
        
        return $qb;
    }

    protected function mapListFields(DataGridService $grid) {
        $grid->addField('name', 'string', [
            'sortable' => false,
            'filterable' => false,
        ]);
    }

    protected function mapFormFields(FormBuilder $formBuilder) {
        $formBuilder->add('name');
    }
}

Create Service:

item_admin:
    class: AppBundle\Admin\ItemAdmin
    arguments: ['AppBundle\Entity\Item']
    tags:
        - { name: bbit.admin, label: 'items', icon: 'glyphicon glyphicon-apple' }

Config:

bbit_admin:
    route_prefix: admin       # optional
    disable_auth: false       # optional

Routing:

bbit_admin:
    resource: "@BBITAdminBundle/Resources/config/routing.yml"
    prefix:   /