[Templates] Trying to remember the change

Andy Wardley abw at wardley.org
Thu Feb 28 07:35:06 GMT 2008


Bill Moseley wrote:
> Ah, yes.  It's CDBI so in list context it's returning a list not a
> an array ref.  I guess that's why I have that as_list() function.

The .list vmethod will Do The Right Thing[tm] in TT3 so that you can
write:

   [% artist.cds.list.nsort.join( ', ' ) %]

and be sure that you end up with a list of items, even if you only got
one back from CDBI.  It currently does something different for hash.list
which, with the benefit of hindsight, is clearly the wrong thing.

Cheers
A



More information about the templates mailing list