I'm working with symfony2 and I need to send data from javascript function to the controller.
This works when there is no data to send in the url
document.location.href="{{path("modifMalade")}}"
But I don't know how to do to put parameter on it?
I'm working with symfony2 and I need to send data from javascript function to the controller.
This works when there is no data to send in the url
document.location.href="{{path("modifMalade")}}"
But I don't know how to do to put parameter on it?
All you need is just to read the docs:
http://symfony.com/doc/current/reference/twig_reference.html#path
In your case, it could look like this:
document.location.href="{{ path("modifMalade", {'param1': 'value1'})}}"