title: OpenTBS iteration over an array
body: <p>I am trying to loop through a simple array and display its information in my <code>docx</code> template with <code>OpenTBS</code>, but can't get it working :(</p>
  
  <p>So I have a farely simple <code>array</code>, that I assign to a block as followed:</p>
  
  <pre><code>$TBS = new \clsTinyButStrong();
  $TBS-&gt;Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
  $TBS-&gt;LoadTemplate($template, OPENTBS_ALREADY_UTF8);
  $myArray = array(   array( 'name' =&gt; 'bedroom'),
                      array( 'name' =&gt; 'kitchen'),
                      array( 'name' =&gt; 'lounge'),
                  );
  $TBS-&gt;MergeBlock( 'myBlock', $myArray);
  $output_file_name = 'C:/testTBS.docx';
  $TBS-&gt;Show(OPENTBS_FILE, $output_file_name);
  </code></pre>
  
  <p>In my <code>docx</code> template, I have tried few simple things like this:</p>
  
  <pre><code>[myBlock.name]  =&gt; doesnt display anything
  </code></pre>
  
  <p>Ideally, I want to repeat a whole block, as you can imagine my array will be a bit more complexe.</p>
  
  <p>I have tried that other solution:</p>
  
  <pre><code>[myBlock; block=begin]
      Name : [onshow; myBlock.0.name;]
      Name : [onshow; myBlock.$;]
      Name :  [onshow; myBlock.#;]
      Name :  [onshow; name;]
      Name :  [onshow; BlockName.0;]
  [myBlock; block=end]
  </code></pre>
  
  <p>So that kind of works, as it properly iterates over the array (it displays everything 3 times, which is good considering I have 3 sub arrays).
  But with that option, I can not find how to display the name, as everything I tried just don't display it, as you can see on my output:</p>
  
  <pre><code>Name : [onshow; myBlock.0.name;]
  Name : 
  Name :  [onshow; myBlock.#;]
  Name :[onshow; name;]
  Name :[onshow; BlockName.0;]
  
  Name : [onshow; myBlock.0.name;]
  Name : 
  Name :  [onshow; myBlock.#;]
  Name :[onshow; name;]
  Name :[onshow; BlockName.0;]
  
  Name : [onshow; myBlock.0.name;]
  Name : 
  Name :  [onshow; myBlock.#;]
  Name :[onshow; name;]
  Name :[onshow; BlockName.0;]
  </code></pre>
  
  <p>(I have also tried the same thing without the <code>onshow</code>, with no luck)</p>
  
  <p>I am sorry to ask such a simple question as how to iterate over an array, but even with reading over few other posts on the subject, the docs, or going through the exemple they provide, I was not able to find the solution for this simple problem :(</p>
  
  <p>Thanks a lot for your help, let me know if you need more info !</p>