[nycphp-talk] <script language="php">
Chris Shiflett
shiflett at php.net
Thu Feb 6 22:38:20 EST 2003
--- Sean Smith <ssmith at tomega.com> wrote:
> I don't see how you can't use those below the top
> of the page. I completely understand having form
> parsing and sql requests etc. at the top of the page,
> and I also use classes and user defined functions.
> But, if I recieve sql query results and populate the
> appropriate variables how else do you display the
> variable values in HTML other than using <?php echo
> $bar; ?> ?
You can use a templating engine such as smarty
(http://smarty.php.net/), which is what I suppose he was
referring to. That is just his opinion, however, and there
is nothing wrong with your method either.
Personally, claiming that all logic should occur "at the
top of the page" sounds a bit amateur to me. :-) That makes
it sound as if each URL equates to a single PHP script,
which demonstrates a lack of software design. But then
again, maybe I am misinterpreting his statement.
I prefer modular frameworks in general, whatever they may
be. I don't use a templating engine, but that is because I
have never managed a team of developers where any of them
were only HTML jockeys (meaning, the people writing the
HTML have always been the same people writing the
PHP/mod_perl/ColdFusion/etc.), and an intelligent software
design can achieve almost the same separation of
presentation that a templating engine can without the
slight performance loss (regardless of how slight that may
be).
Anyway, just another perspective for you.
Chris
More information about the talk
mailing list