Re: [PHP Template] Recursive hide behavior

[email protected] (Dan Libby) Wed, 01 Mar 2000 01:12:53 -0800
Newsgroups php.template
Message-ID <[email protected]>

Andrei Zmievski wrote:

> I can see several possible things you'd want to do:
>
> 1. Hide if any variable is undefined.
> 2. Hide if any contained section is hidden.
> 3. Hide if a specific variable is undefined.
> 4. Hide if a specific section is hidden.
>
> Or a combination of course. :) The tough thing is to figure out a good and
> easy to remember syntax for this and what to use as the defaul behavior.
> Any comments?
>
> -Andrei

From a syntax perspective, 3 & 4 should be identical, so long as both have unique
ids.  1 & 2 are nice to have, but not strictly necessary, since all
variables/sections could be explicitly listed.  For completeness, none should also
be an option, even though it is the default.  (HTML usually works that way)

So I would see the syntax as looking like:

autohide="all" or
autohide="sections" or
autohide="vars" or
autohide="$section1" or
autohide="$section1,$var1" or
autohide="sections,$var1" or
autohide="vars,$section1"

An alternative syntax that may be easier to parse is to have multiple autohide
statements, eg:

{{section:foo autohide="section1" autohide="$var1"}}

However, this seems cumbersome.

$.02

-dan