Re: undefined vars in 'if' statements
[email protected] (Andrei Zmievski) Tue, 22 Feb 2000 13:31:19 -0600
| Newsgroups | php.template |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 22 Feb 2000, Dan Libby wrote:
> For example:
>
> {{:if $fname=="dan"}}
> First: {{fname}}<BR>
> Last: {{lname}}
> {{/:if}}
>
> In this case, if lname is undefined, it would be blank, however in the next
> example the entire if statement would be hidden.
What would you do if it also has {{ else }}?
> {{:if $fname=="dan" autohide="yes"}}
> First: {{fname}}<BR>
> Last: {{lname}}
> {{/:if}}
>
> The alternative is:
>
> {{:section foobar autohide="yes"}}
> {{:if $fname=="dan"}}
> First: {{fname}}<BR>
> Last: {{lname}}
> {{/:if}}
> {{/:section foobar}}
Maybe what we need are anonymous sections, i.e. those without a name.
These can be used to just show/hide blocks of content.
> Seems reasonable. We need to define the difference between undefined and an empty
> string though.
Any ideas?
-Andrei
"In My Egotistical Opinion, most people's C programs should be indented
six feet downward and covered with dirt." -- Blair P. Houghton