[htmltmpl] TMPL_IF truth vs definition
Brought to you by:
samtregar
From: Tugrul G. <tu...@ga...> - 2002-06-21 03:14:27
|
Even though I read the documentation for HTML::Template at some point, I had gotten into the habit of using TMPL_IF in the sense of if a variable is defined instead of if it is true. Now 99% of the time this just happens to work, as most defined things are also considered to be true. But that 1% needs to be dealt with. I realize I could do this with H::T::Expr, but I don't want to go that far (and it would require changing a lot of templates ;). And I could start evaluating the defined condition in the code and exporting booleans, but that triggers the valid warning in the documentation about that. And I feel that ifdefined is fundamentally simple enough (almost simpler than if true since its almost not even logic) that it should be included. Now that I've lobbied for my cause :), I know a patch is generally a big help in getting it passed. The question I have is how to proceed: 1) Add a flag to switch TMPL_IF to the alternate behaviour (if defined vs if true) 2) Add another tag TMPL_IFDEF or similar. Tugrul Galatali |