Skip to content

Instantly share code, notes, and snippets.

@rileyrg
Created October 24, 2017 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rileyrg/3591a7d74a5417af48d7bdd113d9b812 to your computer and use it in GitHub Desktop.
Save rileyrg/3591a7d74a5417af48d7bdd113d9b812 to your computer and use it in GitHub Desktop.
{% macro isUserDisplay(template,value,errorTemplate) %}
{% import _self as h %}
{% if h.isUser() %}
{% if value is defined and value is not null %}
{{ value }}
{% else %}
{% include template %}
{% endif %}
{% else %}
{% include errorTemplate|default(":User:useronly.inform.html.twig") %}
{% endif %}
{% endmacro %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment