如何使用twig中的get参数渲染控制器?
{{ render(controller('AutoBundle:MyController:main', { 'id': id, 'active': true } )) }}
Run Code Online (Sandbox Code Playgroud)
Mat*_*teo 10
与doc一起,查询参数是第三个参数.
{{controller(controller,attributes,query)}}
试试这个:
{{ render(controller('AutoBundle:MyController:main', {}, { 'id': id, 'active': true } )) }}
Run Code Online (Sandbox Code Playgroud)
希望这有帮助