Re: [PHP Template] dynamic blocks

From: Date: Wed, 16 Feb 2000 23:36:15 +0000
Subject: Re: [PHP Template] dynamic blocks
References: 1 2 3 4  Groups: php.template 
Request: Send a blank email to php-template+get-95@lists.php.net to get a copy of this message
Dan Libby wrote: > > So they are already going to see the variable names when viewing static html. > {foo}. What is so wrong with also seeing the dynamic declarations? > > The only viable alternative I see is angle brackets, but having used such a > system, I can say that it gets *very* confusing, when you start having things > like: > > <section: link> > <a href="<link>"><font face="<fontface>" > size="<fontsize>" > color="<fontcolor>"><linktext></font></a> > </section: link> That is a bit confusing, I would definately vote against using angle brackets for template variables. It might still work well for template markup though, like so: <section: name=link> <a href="$link"><font face="$fontface" size="$fontsize" color="$fontcolor">$linktext</font></a> </section: name=link> <if $title != "foo"> <b>$title</b> <else> <b>none</b> </if> Combine proper indenting helps keep things readable, like any HTML. Add syntax highlighting to your text editor to really make a nice programming/designing environment. I still like the idea of giving attribute names (name=link in this example) so we can keep it flexible and easy to parse. > compare that to: > > {section: link} > <a href="{link}"><font face="{fontface}" > size="{fontsize}" > color="{fontcolor}">{linktext}</font></a> > {/section: link} This works too, its a new tag for the designer to learn, but usable. again, maybe name attributes like so: {section: name=link} <a href="{link}"><font face="{fontface}" size="{fontsize}" color="{fontcolor}">{linktext}</font></a> {/section: name=link} {if: {title} != "foo"} <b>{title}</b> {else:} <b>none</b> {/if} Monte

« previous php.template (#95) next »