Re: [Cheetahtemplate-discuss] #block with arguments
Brought to you by:
rtyler,
tavis_rudd
From: Mike O. <slu...@gm...> - 2007-01-24 13:50:59
|
On 1/24/07, leenoori <lee...@qu...> wrote: > El 24/1/2007, a las 1:22, Mike Orr escribi=F3: > > > So I'll have to make do with #def and an explicit placeholder instead. > > It seems like #block should be extended to handle arguments. > > Especially seeing as #block, from the template author's perspective, > is just a special case of #def, right? As we have been documenting it, #block is the same as #def plus an implicit placeholder. #def doesn't produce any output where it's defined, but #block produces a call to itself. So users expect #block to have all the features of #def. If there's a technical reason why it can't, this needs to be known. The reason this came up is I put a #block inside a #for loop to add optional columns to a table, and the argument is the loop variable. Since the loop variable is local, it's not visible in method calls unless it's passed as an argument. Perhaps this hasn't been tried with #block's before. --=20 Mike Orr <slu...@gm...> |