Re: [PHP Template] Template Discussion
[email protected] (Andrei Zmievski) Wed, 22 Mar 2000 15:09:26 -0600
| Newsgroups | php.template |
|---|---|
| Message-ID | <[email protected]> |
Hi, Peter
On Wed, 22 Mar 2000, Peter Kocks wrote:
> Exactly. That's the beauty of php, it is both very simple
> and very powerful at the same time. With php you don't have
> to have a heavy dependency on the programmer because you,
> the designer, can control the layout of the page using
> existing PHP "if" and "while" statements. You don't have to
> know about object oriented programming or how to connect to
> a database or how to compile code just to adjust the format
> of the page.
>
> That's one, if not THE, benefit of php. So, why would you
> want invent a whole new syntax and, in effect, a whole new
> language to achieve the same result?
I'm sorry, but for() and while() are much more complicated that what
we're proposing. Monte had a good example:
Current proposed spec
---------------------
{section}
{@Name}<br>
{@Address}<br>
{@Phone}<p>
{/section}
The way you suggest doing it
----------------------------
<? for($loop=0; $loop<=count($Name); $loop++): ?>
<? print $Name[$loop]; ?><br>
<? print $Address[$loop]; ?><br>
<? print $Phone[$loop]; ?><p>
<? endfor; ?>
In my opinion, the first version is much easier to read, modify, and
work with in general. And this is a very common situation.
-Andrei
* Only 19,999 lines of C++ to my next ski trip... *