Created
August 14, 2013 19:26
-
-
Save hubertperron/6234629 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro generate(mapping) %} | |
{% if mapping.type == 'route' %} | |
<a href="{{ path(mapping.target) }}">{{ mapping.section|default('Link'|trans) }}</a> | |
{% elseif mapping.type == 'render' %} | |
{{ render(controller(mapping.target)) }} | |
{% elseif mapping.type == 'include' %} | |
{% include mapping.target %} | |
{% elseif mapping.type == 'url' %} | |
<a href="{{ mapping.target }}">{{ mapping.section|default('Link'|trans) }}</a> | |
{% elseif mapping.type == 'raw' %} | |
{{ mapping.target|raw }} | |
{% endif %} | |
{% endmacro %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment