Symfony Twig {{render}} 处理传递的参数 [英] Symfony Twig {{render}} handling passed arguments
本文介绍了Symfony Twig {{render}} 处理传递的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在模板上我做了一个 render
方法:
Over a template I do a render
method:
{{ render(controller('AppBundle:Widgets:myCapsWidget'),{'somestring':someString}) }}
在控制器上我有以下方法:
Over the controller I have the following method:
public function myCapsWidgetAction($somestring)
{
return new Response(strtoupper($somestring));
}
我还查看了这些链接:
但仍然找不到任何通往我的道路的光.
But still cannot find any light to my path.
推荐答案
如果我读了你给我们的第一个链接,你应该使用:
If I read the first link you gave us, you should use:
{{ render(controller('AppBundle:Widgets:myCapsWidget',{'somestring':someString})) }}
这篇关于Symfony Twig {{render}} 处理传递的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文