For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > February 2005 > caching problem with multiple fetch









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author caching problem with multiple fetch
Abdul-Wahid Paterson

2005-02-25, 4:02 pm

Hi,

I have something in my code like this...


$smarty->caching = true;
if(! $smarty->is_cached('some.tpl') ) {
// Do some database things

......

}

$text1 = $smarty->fetch('some.tpl');

// assign some different vars

$text2 = $smarty->fetch('some.tpl');


Now, the variables i assign between the firsrt fetch and the second
are all dynamic content within the some.tpl that are put in side a
{dynamic}{/dynamic} block

What happens....if at the top the page is cached...then both fetches work
where as.....if at the top the page is not cached...the first fetch
works but the second fails.

I get an error something like,,,,

Fatal error: Call to undefined function:
_smarty_tplfunc_4c569462d19b164ea6639c6f
4437b1aa_0() in
/usr/lib/php/Smarty/Smarty.class.php on line 1821

I presume this is something to do with the way pages are actually
cached. Can someone who knows more about the inner workings of smarty
shed any light on this?

Does the fetch() itself write the cached page?

Thanks,

Abdul-Wahid
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com