[thelist] Re: PHP inside or outside?

Carl Meyer carljm at goshen.edu
Sun May 2 19:31:04 CDT 2004

On Sun, 25 Apr 2004, Joao Verde wrote:

> Having read all the opinions expressed here - which I thank - I guess I'll stick with PHP start-to-end echoing HTML inside it. Even though I lose HTML readability, that allows me to focus on PHP itself which is my primary responsibility.
> I'll also give a look at the heredoc syntax...

IMHO "PHP inside or outside" is the wrong question entirely.  Mixed code and
HTML is a maintenance nightmare - no matter which way you write it, it's
mixing application logic and presentation.  I always use a templating engine
which allows total separation of HTML from PHP code.  Smarty[1] is popular
and feature-heavy, there are simpler ones available.  The little you lose in
processing time you make up many times over in code readability and

my .02

[1] http://smarty.php.net

More information about the thelist mailing list