0

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?

Opal
  • 81,889
  • 28
  • 189
  • 210

1 Answers1

0

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'})}}"
fperet
  • 436
  • 8
  • 21