RE: caching / insert question

From: Date: Sat, 16 Feb 2002 03:28:07 +0000
Subject: RE: caching / insert question
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2692@lists.php.net to get a copy of this message
At 07:28 PM 2/15/02 -0800, Steve wrote:
Are you using $cache_id parameter to display() function? -Andrei Ut Oh! Not sure how I'm supposed to use the $cache_id in the display() call?
The idea is this: a single template can generate different output depending on certain set of conditions. In your case it seems that these conditions are 'page' and 'id' variables that are used to control what is displayed in the template. Smarty can keep different cache files for every unique set of such conditions for each template, all you need to do is pass some sort of cache identifier to display() function. You could do it like: $smarty->display('my.tpl', "$page,$id"); or you can base cache id on your entire request URI by doing: $smarty->display('my.tpl', $GLOBALS['REQUEST_URI']); See online documentation for more info. HTH, -Andrei

« previous php.smarty.general (#2692) next »