我已安装sonatapagebundle并使用命令行生成所有路由:
php app/console sonata:page:update-core-routes --site=all
当我访问公共主页的管理部分的作曲家页面时,我收到了此消息:
Warning! Before using the composer option, you need to configure the template layout.
The configuration must be done in the sonata_page.templates section.
See a complete exemple here:
sonata_page:
# [...]
templates:
default:
path: 'ApplicationSonataPageBundle::demo_layout.html.twig'
name: 'default'
containers:
header:
name: Header
content_top:
name: Top content
content:
name: Main content
content_bottom:
name: Bottom content
footer:
name: Footer
matrix:
layout: |
HHHHHHHH
TTTTBBBB
TTTTBBBB
TTTTBBBB
TTTTBBBB
CCCCCCCC
CCCCCCCC
FFFFFFFF
mapping:
H: header
T: content_top
C: content
B: content_bottom
F: footer
但是我的config.yml为sonata_page类别提供了这一行。我做错了什么?
感谢您的帮助。
答案 0 :(得分:2)
我有同样的问题......问题是在config.yml我有两次
templates:
default: {path: 'SonataPageBundle::layout.html.twig', name: default }
...
templates:
default:
path: 'ApplicationSonataPageBundle::layout.html.twig'
name: 'default'
...
请再次检查config.yml文件并删除重复项(如果是大小写)。