Share » Forums » Developer » excel export: how to spare memory in...

excel export: how to spare memory in tpl ?

excel export: how to spare memory in tpl ?

Wednesday 22 July 2009 12:10:58 pm - 3 replies

Modified on Wednesday 22 July 2009 12:11:27 pm by Seb Gaillard

Author Message

Max Keil

Wednesday 22 July 2009 4:41:49 pm

Hi Seb,

your last 3 line looks ike this! I see, that you forgot to close the "for" method?

{undef $elements}
{for}
</table>
</html>

For exporting huge information containers, I would prefer to use native PHP functions instead of Template code!

It's also not clean to def the same variable within the {for}{/for}. Use "set" for this and def the variable before the loop.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Seb Gaillard

Thursday 23 July 2009 12:35:39 am

Hi Max,

Effectively I forgot to close the for method... Now, it work's fine! I think that after a lot of hours with the nose through the code, I didn't see anything...

Otherwise, I create (def) the $elements varliable in each loop because I hope that "{undef}" free memory. Do you know:
1/ If it's true ?
2/ if I use {set ...}, the memory is spared too?

Do you know where can I find an exemple who "use native PHP functions instead of Template code" for doing this ?

Thank's,

Seb

Max Keil

Thursday 23 July 2009 5:43:53 pm

You're right,

undef should be more memory efficient.

native PHP: you can create a simple template fetch function or module which would do the same work for you and generate the html, but much more efficient - because of the loops and fetches.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu