title: How do I display data in my foreach in EOD tcpdf?
body: <p>I am new in the tcpdf.. I am currently doing a project where I am using the tcpdf(because I want to export my table in pdf that has a template of it). I tried to do some research and I've found the method writeHTML(). In this method I can now make any html tags</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public function testing(){
          $this-&gt;load-&gt;library('Pdf');
          $this-&gt;load-&gt;model('newModel');
          $data['accounts'] = $this-&gt;newModel-&gt;get('users');
          $this-&gt;load-&gt;view('admin/testing',$data);
      }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>$txt = &lt;&lt;&lt;EOD
  &lt;table cellspacing="0" cellpadding="1" border="1"&gt;
      &lt;tr&gt;
  
          &lt;td&gt;COL 2 - ROW 1&lt;/td&gt;
          &lt;td&gt;COL 3 - ROW 1&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;?php foreach($accounts as $try):?&gt;
          &lt;td&gt;$try-&gt;first_name&lt;/td&gt;
          &lt;td&gt;Hala2   &lt;/td&gt;
          &lt;?php endforeach?&gt;
      &lt;/tr&gt;
  
  
  &lt;/table&gt;
  EOD;
  $pdf-&gt;writeHTML($txt, true, false, false, false, '');
  </code></pre>
  
  <p><strong>Model</strong></p>
  
  <pre><code>public function get($table)
      {
          $result = $this-&gt;db-&gt;get($table);
          return $result-&gt;result();
      }
  </code></pre>
  
  <p>Question: How can I display all my data in EOD? Is there any method like writePHP()? To allow me to do some php coding?</p>