Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Brian Wisti
RE: What constitutes true/false for [% if %]? [ reply ]  
2006-06-20 22:51
I went for a Perlish evaluation of true/false for PageTemplate where practical, because it made it easier to do things like skip display of empty lists or empty strings rather than put in support for more explicit logic within the template language.

That's the idea, anyhow.

By: Paul DuBois
What constitutes true/false for [% if %]? [ reply ]  
2006-06-20 02:07
For [%if condition%], what kinds of values should be considered true/false?

I find that any of the following evaluate to false:

"" (empty string)
nil
false
[ ] (empty array)
{ } (empty hash)

which is not quite the same as what "if" in a Ruby script will
consider false. What's the principle that controls true/false
in PageTemplate?