我不知道为什么它会显示这个错误
The function "dump" does not exist in twig file虽然我已经在config.yml文件中写入:
services:
product_store.twig.extension.debug:
class: Twig_Extension_Debug
tags:
- { name: 'twig.extension' }在twig文件中,我尝试使用以下命令进行转储:
{{ dump(product) }}发布于 2016-01-21 20:09:41
被接受的答案对我不起作用。我所要做的就是在AppKernel中启用DebugBundle (仅在开发/测试环境中):
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();就是这样。不需要注册任何服务。
https://stackoverflow.com/questions/12159373
复制相似问题