RE: [SMARTY] Caching particular parts of a page
| From: | Josh Johnson | Date: | Mon, 30 Sep 2002 20:02:36 +0000 |
| Subject: | RE: [SMARTY] Caching particular parts of a page | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6056@lists.php.net to get a copy of this message | ||
So you want the login box to show up dynamically, but you want to use
caching?
-- Josh
-----Original Message-----
From: Oleg Krogius [mailto:olegk@cgshock.com]
Sent: Monday, September 30, 2002 3:58 PM
To: smarty-general@lists.php.net
Subject: [SMARTY] Caching particular parts of a page
Hi,
I have a page that's cached by smarty. Here's a bare bone example of the
total thing that gets cached:
header...
{$nav}
blah blah
{$abc}
blah blah
{$content}
footer...
I want everything in that template to be cached but one variable (user
login/logout box) - $abc in above example.
What's the best approach for me to take doing this? Currently I've been
thinking about something along these lines...
//all init code
$t->caching=1;
$t->assign($nav,'pages...');
$t->caching=0;
$t->assign($abc,$t->fecth('loginbox'));
$t->caching=1;
$t->assign($content,'text');
$t->display('main');
..but how effecient would that be? Is there a better approach?
Thanks for your time,
Oleg Krogius.
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php