title: Converting Opencart .tpl into .twig
body: <p>I am currently trying to add some code to Twig file that I already use with PHP.
  Made some changes based on <a href="https://twig.symfony.com/" rel="nofollow noreferrer">https://twig.symfony.com/</a> but still can't get it work properly. 
  Here is the <code>.tpl</code> file that uses php: </p>
  
  <pre><code>&lt;?php foreach (array('catalog'=&gt;'frontend', 'admin'=&gt;'backend') as $k=&gt;$v ) { ?&gt;
      &lt;label class="btn btn-default &lt;?php if($interface==$k){ echo 'active'; } ?&gt;"&gt;
      &lt;input type="radio" name="interface" value="&lt;?php e($k); ?&gt;" autocomplete="off" &lt;?php if($interface=="$k"){ echo 'checked'; } ?&gt;&gt; &lt;?php e(${'tab_'.$v}); ?&gt;
      &lt;/label&gt;
  ?&gt;
  </code></pre>
  
  <p>into this:</p>
  
  <pre><code>{% for k,v in array_path %}
  catalog: {{frontend}}
  admin: {{ backend }}
  &lt;label class="btn btn-default  {% if interface == k %} {{ active }} {% endif %} &gt;
      &lt;input type="radio" name="interface" value="{{ k }}" autocomplete="off" {% if interface == k %} {{ checked }} {% endif %}&gt; {{tab_.v}}
  &lt;/label&gt;
  </code></pre>
  
  <p>and another <code>expression</code>: </p>
  
  <pre><code>&lt;?php e($page == '_main_lang_file' ? $text_main_lang_file : $page); ?&gt; 
  &lt;?php 
      echo (isset($translations[$l['directory']]) &amp;&amp; $translations[$l['directory']] != '') ? 
      hs($translations[$l['directory']]) : '&lt;span class="notTranslatedSpan text-danger"&gt;'.h($text_not_translated).'&lt;/span&gt;';
  ?&gt;
  </code></pre>
  
  <p>into this: </p>
  
  <pre><code>{{ page == '_main_lang_file' ? text_main_lang_file : page }}
  {% translations l.directory &amp;&amp; translations l.directory != '') ? 
      hs translations l.directory : '&lt;span class="notTranslatedSpan text-danger"&gt;'.h text_not_translated'&lt;/span&gt;'} %}
  </code></pre>
  
  <p>But I can't understand what exactly should do to make it work.</p>