Im writing an application using Symfony2 for the backend and backbonejs + underscore for the frontend, since I need everything to be easily crawled by the search engine I still use twig. When a template needs to be rendered live (example picture upload without reloading) then I use underscore.
<a href="{{ path('singlepost', {'postnumber': '<%= imageId %>' }) }}" target="_blank">
<img id="lsrc<%= imageId %>" src="" id='lazyload<%= imageId %>' class='content-bubble-img'>
</a>
Everything is working fine on img tag, when I pass a value from backbone to the template (the imageId), what doesn't work is passing the same value to the twig path() method.
Instead of returning an integer like on the img tag it returns the path localhost/app_dev.php/post/%3C%25-%20imageId%20%25%3E of course I need it to return the <%= ImageId %> value, I think twig is escaping the input in this case but verbatim(called raw before) won't work in this case