简体   繁体   中英

Symfony2. Show SonataAdminBundle listAction() on main dashboard's page

I want to make a custom view an editable entity.

By default dashboards showing links to edit entities `(/links, where controller is CRUDController::listAction)

It is looks like: 在此处输入图片说明

But I need to show on main dashboard's page an enities's table like: 在此处输入图片说明

I have block to display on dashbord(service).

services:
sonata.block.service.date:
    class: My\AuditBundle\Block\DateBlockService
    arguments: ['sonata.block.service.date',@templating,@sonata.admin.pool,@service_container]
    tags:
        - { name: sonata.block }

How can I show table into block? Thanks.

You need to create a service to be injected in a block you can display on homepage

there is a script how to create a block in sonata admin homepage here :

SonataAdminBundle : display non crud (statistics)

and the sonata block bundle documentation :

http://sonata-project.org/bundles/block/master/doc/reference/your_first_block.html

once you have created your block you just need to override the base_list template into your custom block template :)

hope this will help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM