twig attribute class I want to add multiple class to my {{item}} twig template. The following code

{% set item = item|merge({'#attributes': { 'class': 'project-label'}}) %}


sets only one class ... how can I assign multiple class ? can i do something like this

{% set item = item|merge({'#attributes': { 'class': 'project-label'}}),
({'#attributes': { 'class': 'project-term{{ loop.index }}'}}`)%}


Please help.

Thanks
Put the classes in an array:

{%
  set itemclasses = [
    'project-label',
    'project-term' ~ loop.index,
  ]
%}


And add the array to attributes:

{% set item = item|merge({'#attributes': { 'class': itemclasses } }) %}