Re:Re:Re:[BEGINNER] Question about caching
| From: | Brian E . Lozier | Date: | Fri, 28 Dec 2001 21:16:37 +0000 |
| Subject: | Re:Re:Re:[BEGINNER] Question about caching | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2418@lists.php.net to get a copy of this message | ||
The main template doesn't include another template. The main template has a {$Content} field
that my
application populates depending on what page you're accessing.
*ALL* my $tpl->display() calls (on every single one of my pages) look like:
$tpl->display('main.tpl');
At the end of EVERY page in my application. Because 'main.tpl' contains my entire design.
[html][body]
{$Content}
[/body][/html]
Then I populate {Content} with a $tpl->fetch() command, such as:
$tpl->assign('Content', $tpl->fetch('userregister.tpl'));
or on a different page:
$tpl->assign('Content', $tpl->fetch('viewcomments.tpl'));
----- Original Message -----
From: Andrei Zmievski <andrei@ispi.net>
To: "Brian E. Lozier" <brian@massassi.net>
Date: 12/28/01 1:06:29 PM
>
>On Fri, 28 Dec 2001, Brian E. Lozier wrote:
>> >> The whole method seems to break as soon as you start using ->fetch(), though.
>> >
>> >What do you mean? Any short examples?
>>
>> I've posted 3 examples previously on this list. When I have an outer
>> 'main.tpl' and then the content is
>> handled by inner ->fetch() calls, the caching gets confused and simply doesn't
>> work. It keeps returning
the
>> same content, no matter what 'cache_id' I pass.
>>
>> I think the problem lies in the fact that at the end of EVERY page, I've got
>> $tpl->display('main.tpl') -
so
>> the thing always caches in the same place, no matter what. If I pass a $REQUEST_URI, it
>> caches the outer
>> template correctly, but not the inner template. If I pass a $REQUEST_URI to my
>> ->fetch('index.tpl'), it
>> seems to CACHE the content correctly (I can view it if I go to the right dir or use the
>> display function
on
>> THAT template), but it doesn't get outputted when I
>> do->display('main.tpl'). That just displays whatever
one
>> got cached last time.
>
>Hold on, how are your templates organized? You have a main template that
>includes another template and you are calling display() on the main one.
>Where does fetch() come in?
>
>-Andrei
>* Anything will fit if you push hard enough. *