Reputation: 1838
I have a controller function which return a response with a value, and I want to call this controller from twig so I use:
{% render "UaePortailBundle:Note:isRempli" with { 'module_id' : module.id , 'year' : year } %}
the problem is that I want to set this returned value into a variable "x"
I tried this, but it doesn't work.
{% set x = {% render "UaePortailBundle:Note:isRempli" with { 'module_id' : module.id , 'year' : year } %} %}
Upvotes: 2
Views: 2470
Reputation: 5874
According to the documentation, you can do:
{% set x %}
{% render "UaePortailBundle:Note:isRempli" with { 'module_id' : module.id , 'year' : year } %}
{% endset %}
Upvotes: 6