Over a template I do a render method:
{% set someString = "non-default" %}
{{ render(controller('AppBundle:Widgets:myCapsWidget'),{'somestring':someString}) }}
Over the controller I have the following method:
public function myCapsWidgetAction()
{
//@todo: access the passing parameter
}
My problem is how can I access the somestring parameter? I tried to do
public function myCapsWidgetAction($somestring="default")
{
return new Response(strtoupper($somestring));
}
Then via xdebug I noticed that the passed parameter was default instead of non-default.
I also looked over theese links:
- symfony twig render controller argument array
- https://knpuniversity.com/screencast/symfony2-ep3/render-controller
But still no light in my path.