sonata and single page

我的梦境 提交于 2019-12-02 03:38:14

You should be configuring your admin menu in your app/config.yml.

Here is an example :

sonata_admin:
    dashboard:
        groups:
            content_test:
                label: Content
                icon:  '<i class="fa fa-address-card"></i>'
                items:
                    - route: 'route_to_record1'
                      route_params: { id: 1 } #id of record 1
                      label: Record 1
                    - route: 'route_to_record_2'
                      route_params: { id: 2 }
                      label: Record 2

To find out the route to a record execute the command

app/console (bin/console on sf3) debug:router

This will show you all the routes existing in your app just find the route sonata admin generated for your ContentAdmin for show or edit or whatever you need( ex: admin_content_test_show).then just fill route_params with the id of the desired record.

(you can use that to point to any route in your app and prefill any parameters of that route)

Hope you find this helpful

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!