exception during the rendering of a template (“The

2019-05-21 08:09发布

问题:

Hi I am new to Symfony2 and facing this problem while generating my Admin Panel.

An exception during the rendering of a template ("The block type sonata.Admin.block.admin_list does not exist") in SonataAdminBundle:Core:dashboard.html.twig at line 35

Can anyone please guide me, I'll be Grateful. I am following this documentation Sonata Admin Bundle.

回答1:

You have to specify all blocks in app/config/config.yml:

sonata_block:
    default_contexts: [cms]
    blocks:
        sonata.user.block.menu:
        sonata.user.block.account:
        sonata.admin.block.admin_list:
            contexts:   [admin]


回答2:

Yes All these are already specified in config.yml file, still i am facing that error. But when i comment that statement in SonataAdminBundle:Core:dashboard.html.twig at line 35 it works fine. i don't get any error. Plus i am unable to get my CRUD functionality for my entity in admin panel, admin panel has been generate without any error.



标签: symfony twig