小编use*_*879的帖子

Symfony2 - 块类型sonata.user.block.menu不存在

我有一个例外:

An exception has been thrown during the rendering of a template ("The block type 
sonata.user.block.menu does not exist") in SonataUserBundle:Profile:action.html.twig at 
line 27. 
Run Code Online (Sandbox Code Playgroud)

我已经安装了一个FOSUserBundle + SonataAdminBundle,我的理解,我需要tu安装SonataBlockBundle和其他必需的捆绑包.

我的内核文件:

        new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
        new Symfony\Bundle\SecurityBundle\SecurityBundle(),
        new Symfony\Bundle\TwigBundle\TwigBundle(),
        new Symfony\Bundle\MonologBundle\MonologBundle(),
        new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
        new Symfony\Bundle\AsseticBundle\AsseticBundle(),
        new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
        new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
        new Ibw\JobeetBundle\IbwJobeetBundle(),
        new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
        new Sonata\CoreBundle\SonataCoreBundle(), 
        new FM\BbcodeBundle\FMBbcodeBundle(),
        new FOS\UserBundle\FOSUserBundle(),
        new Sonata\jQueryBundle\SonatajQueryBundle(),
        new Sonata\AdminBundle\SonataAdminBundle(),
        new Sonata\BlockBundle\SonataBlockBundle(),
        new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
        new Knp\Bundle\MenuBundle\KnpMenuBundle(),
        new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),
        new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
        new Application\Sonata\UserBundle\ApplicationSonataUserBundle(),   
Run Code Online (Sandbox Code Playgroud)

Adn my composer.json

    "php": ">=5.3.3",
    "symfony/symfony": "~2.4",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": …
Run Code Online (Sandbox Code Playgroud)

symfony fosuserbundle composer-php sonata-admin sonata-user-bundle

6
推荐指数
1
解决办法
8619
查看次数