Pass variable from js to twig

0

I am trying to pass a variable from js to twig in the following way:

<script>
$('.li').on('click', function(){
    var that = parseInt($(this).attr("id"));
confirm("Estas seguro?, OK para continuar.",
  function(){
    document.location = "{{ path('ruta_company',{'id': ' ~ $that ~ '}) }}";
    return true;
  },
  function(){
    alert('Operacion Cancelada');
  });
});//click

but I can not get the variable conversion.

Any suggestions?

    
asked by matteo 06.08.2018 в 21:12
source

0 answers