Re: [PHP Template] dynamic blocks

[email protected] (Monte Ohrt)
Newsgroups php.template
Organization ispi
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.