Re: [PHP Template] <..> or {{..}} - vote?

[email protected] (Teodor Cimpoesu) Tue, 22 Feb 2000 17:14:31 +0200
Newsgroups php.template
Organization DIGICOM S.A. Romania
Message-ID <[email protected]>
Andrei Zmievski wrote:
> 
> On Fri, 18 Feb 2000, Dan Libby wrote:
> > I vote for defaulting to {{ }}.
> >
> > Perhaps the INI settings should allow:
> > {{ .. }} or
> > <!-- {{ .. }} -->  or
> > < .. >
> >
> > Or we could get really crazy and let people define their own delimiters.  ;-)
> 
> Could be possible althought very inefficient. I'm not sure about < .. >
> idea. Since HTML has lots of those it will slow down the parser.
I'm more used to <.> approach :-)
Before Andrei posted he's manifest, I started a Template class with
makefile
variables style (~ @FOO@).

The best way to decide is to list the pros and cons of eachother.
I'm biased to <.> because I've been using for a while Zope's DTML.
They changed the tags style from <!--#var foo--> to <dtml-var foo>
Yeah, first I said the same thing, *man* I type a lot.

I'm not trying to convince you that their way is the right way, only
to say that we could benefit from their experience with templates.
The big difference is PHP is not Python. You can embed it right in your
file
everywhere you like, but templating raises the same issues regardless of
the
backend parser.

So, one shot would be {{$var}} (as far as I get it)
another one <var $foo>?? (I dunno what you had in mind with <.> tags)
another one <php-var foo> (Zope like)

I preffer the last because:
0. I'm biased :-)

1. It's much more like HTML. Who will read most of the templates?
Designers. What will they do? HTML/CSS styling and design.

2. Remember the <?php issue with Homesite et al. ? They don't like
unknown tags and mess them up! On the other hand, they will show
all {{.}} code.

3. Now, <.> makes them invisible. But there can be a good part too,
they don't bother. You want to debug it? just make a bookmark on
you Netscape with
javascript:window.open("view-source:"+prompt("Location","http://"),"")
or replace prompt(.) with window.document.URL or something.

K, before more propaganda I'll get more documented on DTML and let
the rest know if I found something interesting.
bye
-- 
CIMPOESU Teodor, Web Programmer
 @ DIGICOM S.A. Bucharest, Romania
 @ Internet, site development
 @ see http://internet.digiro.net/