title: PHP Reporting With Templates
body: <p>I'm looking for recommendations on how to do some reporting in PHP.  Specifically, I need PDF rendering and I would like to separate the presentation from my code as much as possible (templates of some sort?).</p>
  
  <p>I've recently received a PHP4 code-base on the job and am in charge of upgrading to PHP5.  The reports currently are created via TCPDF which are driven from HTML generated straight from PHP.  The upgrade process is proving extremely challenging.  I'm running into multiple problems with TCPDF where it will just go into an infinite loop and never return.  Through some troubleshooting and forum posts, it appears we're doing some stuff that TCPDF4 with PHP4 didn't have a problem with but TCPDF5 and PHP5 does.  Unfortunately, rather than error on whatever rules we're breaking, I just get infinite hangs.  Our in-house code could use some refactoring and I feel a re-write could mitigate many of these problems, however I'm not opposed to looking beyond TCPDF right now.</p>
  
  <p>Our code also has a lot of the HTML generation mixed in with the rest of the reporting features.  I would really like to separate this out so that little to no PHP code is required when editing or creating a report.  I don't need anything too fancy for the report.  Needs to support basic data tables and multiple horizontal panes on a single tab.  There are charts but they are currently generated by a separate package and just read directly as an image. Suggestions on the best way to re-do these reports?  Thanks.</p>