On Wed, 26 Dec 2007 14:57:31 -0000, Patrick Burke <[EMAIL PROTECTED]> wrote:

<tal:block tal:define="global prodSellPrice
<td tal:content="money: prodSellPrice"></td>
I haven't tried doing the define in the <td/> tag - I just like to keep that stuff separated.

It should work like this:

<td tal:define="prodSellPrice
 tal:content="money: prodSellPrice">

The benefit is that you avoid creation of global variables, so it will work reliably in recursive macros, etc.

However, it's not even neccessary. In 1.1.9 there's phptal_tale($expression,$nothrow)* function which you can use to evaluate rest of the expression, e.g.:

function phptal_tales_rot13($expr, $nothrow)
        return 'rot13('.phptal_tale($expr,$nothrow).')';

Currently that's the best way to handle nested tales modifiers.

regards, Kornel

*) phptal_tales(), which is availble in older versions and isn't an ugly hack, will work as well, but only for expressions that don't use the "|" operator.

PHPTAL mailing list

Reply via email to