在Symfony2

时间:2016-04-11 16:24:43

标签: symfony entity bundle symfony-routing

我使用的是我自己制作的Custom Bundle,我已经安装了FOSUserBundle。 在我的软件包中,我有UserEntity,它有自己的控制器,并且它的前缀为/admin/user。我希望路线admin_user_showFOSUserBundle:Profile:show

获取操作

这是routing.yml的代码

admin_user_show:
path:     /{id}/show
defaults: { _controller: "CMSBundle:User:show" }
methods:  GET

我将其更改为此但我收到错误:

fos_user_profile_show:
path:     /{id}/show
defaults: { _controller: "FOSUSerBundle:Profile:show" }
methods:  GET

这是我得到的错误:

The "FOSUSerBundle" (from the _controller value "FOSUSerBundle:Profile:show") does not exist or is not enabled in your kernel! Did you mean "FOSUserBundle:Profile:show"?

如何将FOSUserBundle包含在我的Bundle中? 提前谢谢!

1 个答案:

答案 0 :(得分:1)

在我看来,你的路由中有一个拼写错误: FOSUSerBundle:Profile:show代替FOSUserBundle:Profile:show (请注意,在您的情况下,用户中的S是大写)