On 1 Oct 2010, at 09:37, GRolf wrote:

> and how can I solve this if I want to use it in my tal:repeat?
> e.g. for a Client, who has (potentially) multiple "invoices"
> <tr tal:repeat="client clients">
> <td>${client/name}</td>
> <td><span tal:repeat="invoice client/invoices">${invoice}<tal:block 
> tal:condition="not:repeat/invoice/end">,</tal:block></span></td>
> </tr>
> this works fine if I retrieve all invoices before, but can I do it without  
> looping through all clients in PHP first, if I'd have a function 
> getInvoices($client_id)... ? 

I'm not sure what you're asking about. If you don't want to loop clients and 
just display one, then:

<span tal:repeat="invoice php:getInvoices(client_id)">${invoice}<tal:block 

If you want to loop IDs, not client objects, then give PHPTAL array of IDs.

regards, Kornel

PHPTAL mailing list

Reply via email to