Answer the question
In order to leave comments, you need to log in
Is there another way to insert path parameters from js?
Good afternoon.
The task is the following, you need to pass parameters to path from js.
Now I do this:
function( request, response ) {
var url = "{{ path('pet_user_profile_search_street', {'place' : 'oggi', 'street': 'cucaracha'}) }}";
url = url.replace('oggi', $("#addresspicker").val());
url = url.replace('cucaracha', request.term);
$.ajax({
url: url,
dataType: "json",
success: function( data ) {
response( data );
}
});
}
var url = "{{url('route_name')}}/"+var_place+"/"+var_street;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question