Re: YATS (Yet another templating system)
[email protected] (Dan Libby)
| Newsgroups | php.template |
|---|---|
| Message-ID | <[email protected]> |
> So basically just by assigning multiple values to the section variables
> you make them loop, correct?
>
yes. couple of different ways to assign.
> >
> > Syntax:
> >
> > {{variable_name}} or
> > {{variable_name key1="val1" key2="val2"}}
>
> What do key1 and key do?
>
sorry, bad example. They don't do anything. It is merely showing the
html-ish key/val syntax. Currently valid values are 'alt' and
'repeatscalar'.
> > Automatic Hiding
> >
> > If any variable is not found within a section, the entire section will
> > be hidden. This can be useful when there is surrounding text (such as
> > a table row) that should only be displayed if the variable is found.
> > Child sections are also hidden.
>
> This should be configurable.
>
Actually you must specify autohide="yes" if you want this behavior.
Even then, you could always use an alt in your variables to keep it from
hiding. Perhaps you meant the child sections also being hidden should be
optional, but if so I wouldn't agree, as it perverts the meaning of what
a section is.
> I think what templates should also have is:
> - comments
>
yes. So far I've been content with html comments, but you are right.
> - possible support for loading config files (I'm undecided on this
> now)
>
not sure what this buys. Why can't it be done via PHP code? What's it
got to do with display?
> - possible optional evaluation of the template if it has embedded
> PHP code (that's how you would do includes)
>
I toyed with this idea. Allowing embedded PHP code probably means that
the templates will begin to look much like regular HTML files with PHP
embedded. At that point, you've lost your separation between logic and
display.
-dan
danda.vcf
(text/x-vcard, 300 B)
begin:vcard n:Libby;Dan tel;work:650-210-2356 x-mozilla-html:TRUE url:http://www.epinions.com org:Epinions.com;Engineering adr:;;;;;; version:2.1 email;internet:[email protected] title:Morlock note:We're hiring at epinions.com. Engineers, site designers, QA -- we need you. fn:Dan Libby end:vcard