首页 > 代码库 > Render a controller in Twig - Unexpected “render” tag - expecting closing tag for the “block” tag defined

Render a controller in Twig - Unexpected “render” tag - expecting closing tag for the “block” tag defined

Render a controller in Twig - Unexpected “render” tag - expecting closing tag for the “block” tag defined

这样子写{% render(controller("MyBundle:Default:method", { ‘call‘ : ‘action‘ })) %}  

报错Unexpected "render" tag (expecting closing tag for the "block" tag defined

 

那么改为这样子:

{{ render(controller("MyBundle:Default:method", { ‘call‘ : ‘action‘ })) }}

 

Render a controller in Twig - Unexpected “render” tag - expecting closing tag for the “block” tag defined