Re: [htmltmpl] TMPL_IF truth vs definition
Brought to you by:
samtregar
From: Brian M. <bm...@pa...> - 2002-06-21 22:37:44
|
As mentioned briefly in this thread already, you can do this with HTML::Template::Expr. And you don't have to export booleans or anything like that, you can just use "defined," which works just like the perl function "defined" and happens to be one of the functions available in HTML::Template::Expr. <TMPL_IF EXPR="defined ($test)"> Brian McCain PageMasters Internet Group ----- Original Message ----- From: "Douglas Kirkland" <dlk...@rh...> To: <Htm...@li...> Sent: Friday, June 21, 2002 2:16 PM Subject: Re: [htmltmpl] TMPL_IF truth vs definition | On Friday 21 June 2002 09:43 am, you wrote: | > Hi Tugrul, | > | > I normally don't jump in on these conversations, but are you really | > suggesting that TMPL_IF be true if the value of the variable is 0? 0 = true | > goes against everything computers stand for. | > | > > TMPL_IF works all of the time except when the data that exists just | > > happens to be 0 (or anything else that is false). | > | > So, what you are saying is TMPL_IF is false if the data is false. Sounds | > like it works perfectly to me! | > | The problem I see with that, is if the TMPL_IF is reading the data. we | should be able to see if the data equal a value. If that is a case then | there should be something like this: | | <TMPL_IF NAME="FOO" eq 5> | | The data is aready known because it knowns that the data is either zero or | something else. It should not be that much work to do a test against a value. | | my 2 cents | | Douglas | | | ------------------------------------------------------- | Sponsored by: | ThinkGeek at http://www.ThinkGeek.com/ | _______________________________________________ | Html-template-users mailing list | Htm...@li... | https://lists.sourceforge.net/lists/listinfo/html-template-users | |