title: Access php array in smarty
body: <p>I have a object with a method like this: <code>$foo-&gt;getId()</code> which returns an <code>integer</code>, and i have an array like: </p>
  
  <pre><code>$array(
       1=&gt; array(
              "parent_id" =&gt; 14
       ),
       2=&gt; array(
              "parent_id" =&gt; 15
       )
  );
  </code></pre>
  
  <p>I need to access <code>parent_id</code> inside the subarray in smarty using the <code>$foo-&gt;getId()</code> as index key for <code>$array</code>, something like:</p>
  
  <pre><code>{$array[$foo-&gt;getId()].parent_id}
  </code></pre>
  
  <p>also tried just:</p>
  
  <pre><code>{$array[$foo-&gt;getId()]}
  </code></pre>
  
  <p>But both return error:</p>
  
  <pre><code>syntax error: unidentified token 
  </code></pre>
  
  <p>What am i not doing right? </p>