Re: [SMARTY] Another caching Question
| From: | Jason Sweat | Date: | Wed, 15 May 2002 11:05:03 +0000 |
| Subject: | Re: [SMARTY] Another caching Question | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4199@lists.php.net to get a copy of this message | ||
I know you said you did not want to pull from another template, but it would
be very simple to do:
list.tpl:
{html_options options=$mylist}
main.tpl:
<html>
<body>
<select name="sel1">
{$thelist}
</select>
<select name="sel2>
{$thelist}
</select>
in you php script:
$t = new smarty;
$t->caching = true;
$t->cache_lifetime = 86400;
if (!$t->is_cached('list.tpl') {
//big query and assigned to mylist
}
$list = $t->fetch('list.tpl');
$t->caching = false;
$t->assign('thelist', $list);
$t->display('main.tpl');
----- Original Message -----
From: "Ray" <rayge99@hotmail.com>
To: <smarty-general@lists.php.net>
Sent: Tuesday, May 14, 2002 4:28 PM
Subject: [SMARTY] Another caching Question
Ive been reading and reading on caching and from what i see it seems rather
difficult to accomplish selective caching inside a template.
All I would like to accomplish in my current page is to cache 2 items which
are dropdowns pulled from the.
It is a rather Large amount of data when hit many times in a row.
I dont really want to pull it from another template unless that is the only
way it will function.
Anyone having ways they do this type of stuff within the PHP code that
displays the page, or how you currently achieve this method of caching
please Post me a reply.
Thanks