I want to build multidimensional array at Twig I want to build multidimensional  array at Twig. 

In php 

 $attributes['attributes']['class'] = array();
 $attributes['attributes']['class'][] = 'innerTab';
 $attributes['html'] = TRUE;

Same thing I want to build in Twig.
I tried but not getting proper one . Please check my code below 
          {% set ctn = 0 %}
         {% for key, value in menu.menu %}
{% set attributes = {'attributes':'class'} %}
{% set attributes = attributes|merge( [ { (ctn) :'innerTab'} ,  {'html' : true} ]  ) %} 
{% set ctn = ctn+1  %}
 {% endfor %}

As a result I get :


  array(3) { ["attributes"]=> string(5) "class" [0]=> array(1) { [0]=>
  string(8) "innerTab" } [1]=> array(1) { ["html"]=> bool(true) } }
  array(3) { ["attributes"]=> string(5) "class" [0]=> array(1) { [1]=>
  string(8) "innerTab" } [1]=> array(1) { ["html"]=> bool(true) } }
  array(3) { ["attributes"]=> string(5) "class" [0]=> array(1) { [2]=>
  string(8) "innerTab" } [1]=> array(1) { ["html"]=> bool(true) } }
In Drupal 8 use an Attribute object instead of a multidimensional array:

D7 PHP:

$attributes['attributes']['class'] = array();
$attributes['attributes']['class'][] = 'innerTab';


D8 Twig:

{% set attributes = create_attribute() %}
{% set attributes = attributes.addClass('innerTab') %}


You can use the Attribute object in Twig link():

{{ link(title, support_url, attributes) }}