Php Symfony细枝{{render}}处理传递的参数:无法获取其他值

Php Symfony细枝{{render}}处理传递的参数:无法获取其他值,php,symfony,twig,symfony-3.3,Php,Symfony,Twig,Symfony 3.3,在模板上,我执行渲染方法: {% set someString = "non-default" %} {{ render(controller('AppBundle:Widgets:myCapsWidget'),{'somestring':someString}) }} 通过控制器,我有以下方法: public function myCapsWidgetAction() { //@todo: access the passing parameter } 我的问题是如何访问somes

在模板上,我执行
渲染
方法:

 {% set someString = "non-default" %}

{{ render(controller('AppBundle:Widgets:myCapsWidget'),{'somestring':someString})  }}
通过控制器,我有以下方法:

public function myCapsWidgetAction()
{
  //@todo: access the passing parameter
}
我的问题是如何访问
somestring
参数?我试着去做

public function myCapsWidgetAction($somestring="default")
{
  return new Response(strtoupper($somestring));
}
然后通过xdebug我注意到传递的参数是
default
,而不是
non-default

我还查看了这些链接:

但是在我的道路上仍然没有光。

根据

您应该呈现小部件,如下所示:

{{ render(controller('AppBundle:Widgets:myCapsWidget',{'somestring':someString})  }}
查看参数是如何通过控制器方法传递的