我在我的项目中实现了 FOSUser。我成功地重载了表格。
只有当我想覆盖模板时,它才行不通。但我尊重 FOSUser 架构的观点。
你知道什么是问题吗?
最佳答案
查看文档:
https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/overriding_templates.md
基本上有两种方法可以实现您的目标。首先 - 更简单,只需将新模板放入您的应用程序/资源中,例如:
app/Resources/FOSUserBundle/views/Profile/layout.html.twig
第二种方式是:
(...) you can also create a bundle defined as child of FOSUserBundle and place the new template in the same location that is resides in the FOSUserBundle.
关于Symfony 2 无法覆盖模板 FOSUserBundle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15183087/