Re: [PHP Template] A suggestion
[email protected] (Andrei Zmievski) Wed, 1 Mar 2000 08:48:14 -0600
| Newsgroups | php.template |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 01 Mar 2000, Cyrix Haldir wrote:
> IMHO "off" would be easier to understand, when disabling some feature.
> Ifear templates are getting far too complex to the average designer:
> most of them want to read a 15k user manual filled with example and
> start to write down something, rather than try to figure out how the
> engine will default this and this
You're right. The problem is using boolean value off/false/no for
non-boolean attributes, like 'escape'. I mean, if you allow 'off', you'd
have to allow 'on' as well, and then what does 'on' mean? Use default?
> For example the problem about
> {{ section sec1 }}
> {{ $foo }}
> {{ section sec2 }}
> {{ $foo }}
> {{ /section sec2 }}
> {{ /section sec1 }}
> should IMO avoided at all, by restarting the array internal counter
And it will be!
> unless told to do otherwise
> ie
> {{ section sec1 }}
> {{ $foo }}
> {{ section sec2 }}
> {{ $foo DONOTRESTART }}
> {{ /section sec2 }}
> {{ /section sec1 }}
Well, you'd use $sec1:foo or $sec1/foo (I haven't decided yet) to refer
to the value of $foo as it exists in sec1.
> or something similar. Maybe it would be a good idea to make all keyword
> and option verbose, to look like spoken english insted of tech jargon.
> I worked with some designers here in Italy, and all of them consider
> computer and computer program being dump (it's often true, btw ;); we
> should keep templates as simple as possble, so a semi-illeterate
> designer could start working and get productive using default values and
> behaviours, and then learn (if he wants) some more. This is probably one
> of the main reason of PHP's success: it's easy to start, but rather
> powerful in the hands of a programmer.
Ok, but we don't want to turn into COBOL. :) Actually, having easy to
understand syntax (and as close as possible to HTML) is probably good.
That's why I'm thinking $sec1/foo would be a natural way to refer to
variable inside another section (it's sort of like a path). Who knows,
maybe you could refer to a variable in another template with
$tmpl1/sec1/var1.
-Andrei
"Computers are useless. They can only give you answers."
--Pablo Picasso