Re: al-if question
Andrew McNamara <[email protected]> Fri, 29 Jul 2005 16:21:08 +1000
| Newsgroups | gmane.comp.web.albatross.general |
|---|---|
| Message-ID | <[email protected]> |
>> <al-value expr="locals().get('blah','Blah does not exist!')"/>
>>
>> <al-if expr="locals().get('blah',False)"/>
>> Blah Exists
>> <al-else>
>> Blah Doesn't Exist
>> </al-if>
>
>This also works:
>
><al-if expr="__ctx__.has_value('blah')">
It's probably a personal style thing, but I prefer to encapsulate
something like that in an object, or initialise it to None on page entry.
The proposed solutions look a bit non-obvious to me, which will hinder
other people's understanding of your code.
--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/