src/Social/FrontendBundle/Resources/views/body.html.twig line 1

Open in your IDE?
  1. {# Let the '':'' in array and do not alter that line - it will mess up the condition with in array #}
  2. {% set loggedStat = 'not-logged' %}
  3. {% if app.user %}
  4.     {% set loggedStat = 'logged-in' %}
  5. {% endif %}
  6. {% set bodyClassConditions = {
  7.     'social_support' : 'support-page ',
  8.     'social_about_flirto': 'support-page ',
  9.     'social_terms_conditions': 'support-page ',
  10.     'social_privacy': 'support-page ',
  11.     'social_online_safety': 'support-page ',
  12.     'social_frontend_call_window': 'call-window ',
  13.     'social_frontend_call_window_html': 'call-window ',
  14.     '':''
  15. } %}
  16. {% set currentActionArray = app.request.get('_controller')|split('::') %}
  17. {% set controllerStack = currentActionArray|first|split('\\') %}
  18. {% set partOne = (controllerStack|last)|replace({'Controller': ''}) %}
  19. {% set partTwo = currentActionArray|last|replace({'Action': ''}) %}
  20. <body {% if app.request.get('_route') == 'social_user_homepage' %} id="home-page"{% endif %} class="set-language-user-{{ app.request.locale }} {% if app.request.get('_route') in bodyClassConditions|keys %}{{ bodyClassConditions[app.request.get('__route')] }}{% endif %} {{ loggedStat }} {{ partOne|lower ~ '-' ~ partTwo|lower }}">