Friday, 13 September 2013

Use twig in asset sentence

Use twig in asset sentence

It's possible to use a Twig result in asset sentence? See what I'm trying
below:
{% for entity in entities %}
<li title="{{ entity.getName }}" data-id="{{ entity.getId }}"
class="categories-first"><img src="{{
asset('bundles/dashboard/img/categories/{{
entity.getName|lower|replace("ó":"o") }}.gif') }}"></li>
{% endfor %}
But it's not loading the image since this {{
entity.getName|lower|replace("ó":"o") }} isn't evaluated, it's possible?
How?
Also related to this same topic, it's possible to remove special
characters from output? Let said á, é, í, ó, ú and so on?

No comments:

Post a Comment