Re: [PHP Template] Re: [PHP3] template engine example document

[email protected] (Andrei Zmievski) Tue, 28 Mar 2000 08:55:29 -0600
Newsgroups php.template
Message-ID <[email protected]>
On Mon, 27 Mar 2000, Ron Chmara wrote:
> Well, the line programmers shouldn't be arbitrarily inventing their own variables,
> EVER. There has to be some form of consistancy. In this case, the variables are
> known, site wide, by the page designers, and the PHP logic coders.

And who should be inventing new variables?

> $tblcolor is
> something a PHP coder doesn't own, it's not their variable. It's the designer's.

Exactly. That's why designers have .conf file where they setup these
"design" variables and use them in the templates.

> Heh. I thought you kept your designers _out_ of logic? They're doing
> IF/ELSE statements? So much for not needing programming. :-)

The goal is to keep them out of content, mostly. Our designers, for
example, would raise hell if they couldn't do a simple 'if' here and
there.
 
> So far, there's designer set up variables, the .conf file, but
> what about the page logic? Well, you dump the if's and the looping
> on the *designer*, and all you do is make a simplified syntax!

No one is dumping looping on the designer.

> Does this make it more obvious for you? By setting up the concept
> of designer logic, and coder logic, and keeping separate files, your
> template spec led you to recreate PHP, albeit with a modified syntax.
> You can maintain the designer logic, and coder logic, as separate
> files, with the designers doing simplified logic in their files (which
> you are calling templates). For iteration, you recall the same file,
> and with a decent amount of RAM, your overhead is only for the file
> from buffer....
> 
> Of course, the more complex the presentaion logic becomes, the more
> constructs it requires, so you wind up with limited languages like
> a subset of PHP... which can be accomplished by only training them
> in what they can handle, without building another language, with a new
> syntax for loops.

Ok, you proved it's technically possible, but logistically? My god, I
can't imagine having to write "articlecheck.inc" for every looping
construct or to split out all the little pieces into a miriad of .inc
files. That's unworkable both for me _and_ for the designer. We've tried
it, trust me.

-Andrei
* I don't have a solution but I admire the problem. *