Przeglądaj źródła

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 lat temu
rodzic
commit
2c4e0ba3a8
1 zmienionych plików z 1 dodań i 1 usunięć
  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 %}
     {% spaceless %}
+        {% set translation_domain = item.extra('translation_domain', 'messages') %}
         {% 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>' : '') %}
         {% else %}
             {% set icon = item.extra('icon') %}