In symfony2, this works fine in the html.twig file:
<a class="btn brl-next brl-btn" href="{{ path('new_message') }}">Next</a>
but currently, i need to access path('new_message') by javascript.
I tried:
nextButtons.each(function () {
$(this).on('click', function () {
$("a").prop("href", "{{ path('new_message') }}");
});
});
But it's not working, does someone can help me on how to access symfony path by javascript?