17/08
                                    2017
                                
                            
                        
                         Wallogit.com
                    
                    2017 © Pedro Peláez
                    
                    
                    
                    
                
                
            
Twig function that allows addition of attributes that can be rendered in both Drupal and Pattern Lab
Twig function that allows addition of attributes that can be rendered in both Drupal and Pattern Lab. Merges with template level attributes in Drupal and prevents them from trickling down into includes., (*1)
{% set additional_attributes = {
  "class": ["foo", "bar"],
  "baz": ["foobar", "goobar"],
  "foobaz": "goobaz",
} %}
Can also be used with the bem function:, (*2)
{% set additional_attributes = {
  "class": bem("foo", ["bar", "baz"], "foobar"),
} %}