Pārlūkot izejas kodu

Set translation_domain outside if statement

Setting translation_domain inside the if statement would cause the variable to not be setted if the on_top option is true.
Everton Barbosa Jr 8 gadi atpakaļ
vecāks
revīzija
2c4e0ba3a8
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      Resources/views/Menu/sonata_menu.html.twig

+ 1 - 1
Resources/views/Menu/sonata_menu.html.twig

@@ -25,8 +25,8 @@
 
 
 {% block linkElement %}
 {% block linkElement %}
     {% spaceless %}
     {% spaceless %}
+        {% set translation_domain = item.extra('translation_domain', 'messages') %}
         {% if item.extra('on_top') is defined and not item.extra('on_top') %}
         {% if item.extra('on_top') is defined and not item.extra('on_top') %}
-            {% set translation_domain = item.extra('translation_domain', 'messages') %}
             {% set icon = item.extra('icon')|default(item.level > 1 ? '<i class="fa fa-angle-double-right" aria-hidden="true"></i>' : '') %}
             {% set icon = item.extra('icon')|default(item.level > 1 ? '<i class="fa fa-angle-double-right" aria-hidden="true"></i>' : '') %}
         {% else %}
         {% else %}
             {% set icon = item.extra('icon') %}
             {% set icon = item.extra('icon') %}