Symfony2路由和树枝

用户名

我需要profile/edit在我的视图中包含href 模板引擎是树枝,因此代码如下所示:

<a href="{{ path('fos_user_profile') }}">Edit profile</a>

但我得到例外:

An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "fos_user_profile" as such route does not exist.") in VputiUserBundle:ProfileShow:show.html.twig at line 4.

请帮助,哪里出错了?

彼得·贝利

首先,调试您的路由器

$ php app/console router:debug --env=[env]

并使用正确的环境

如果显示路由,则可能需要清除缓存

$ php app/console cache:clear --env=[env]

如果路由显示,则说明提供该路由的任何捆绑软件均未正确加载。

另外,如果您在调试打开的情况下使用前控制器,则可以检查Web调试工具栏

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章