caching based on url
| From: | Ivo Jansch | Date: | Wed, 26 Sep 2001 14:13:34 +0000 |
| Subject: | caching based on url | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-1554@lists.php.net to get a copy of this message | ||
Hi,
I have a situation where the actual content my template shows is determined by a parameter from the url.
For example, I could have site like this:
index.php?page=main
index.php?page=help
There's one template (index.tpl), and I assign the text that I want to display, to a smarty variable somewhat like this:
$text = $mydb->get("select text from pages where pagename='$page'");
$smarty->assign("text",$text);
Now, if I turn on caching, then Smarty always displays the same page, since it apparently only caches per template.
Is it possible to have it cache each 'occurence' of the page? So it would keep a cached version of the main page AND a cached version of the help page. Is this possible?
(If it isn't, I will have a look if I could implement it myself)
Greetings,
Ivo
--
Ivo Jansch <ivo@ibuildings.nl>
ibuildings.nl BV - information technology
http://www.ibuildings.nl