I started using html twig in Symfony2 and I got the following problem:
function goEditConflict(){
$("#go").on("click", function(){
id = $("#case_number").val();
windows.location = {{ path("acf_case_conflict_edit", {"id" : id}) }} ;
});
}
Variable "id" does not exist in ACFCaseBundle:Shared:caseHierachy.js.twig at line 38
I try to redirect page base on the id variable but I got the error that when I try redirect to {{ path("acf_case_conflict_edit", {"id" : id}) }} the variable does not exist.
How can I use a js variable in my twig code?
id. Please check whether such variable is passed to twig template in which you are trying to use it.