SV: Re: SV: Assign in prefilter
| From: | Andreas Heintze | Date: | Mon, 25 Mar 2002 17:07:42 +0000 |
| Subject: | SV: Re: SV: Assign in prefilter | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3336@lists.php.net to get a copy of this message | ||
I'm not blaming anything, I just want to point out that assigning a
var in a prefilter is not a good idéa if your page is cached, since
that var wont be assigned when (if) the cache expires.
Instead (in the prefilter) I tried to assign that var in the template
itself by inserting a {assign var="test" value="whatever"} or {eval
assign="test" var="whatever"}, then I did run into the problem with the
'{' & '}' couldn't be inside the value string... that's why I did
a
workaround.
/Andreas
-----Ursprungligt meddelande-----
Från: Andrei Zmievski [mailto:andrei@ispi.net]
Skickat: den 25 mars 2002 15:20
Till: smarty@lists.ispi.net
Kopia: smarty@lists.ispi.net
Ämne: [smarty] Re: SV: Assign in prefilter
On Sat, 23 Mar 2002, Andreas Heintze wrote:
> OK but this makes assigning vars in a prefilter useless in a cached
> page.
> Since the assigning is done in the prefilters, which is not run when
the
> cache expires. It then runs the compiled template again but it the
vars
> isn't assigned and therefore is missing in the output of the new
cache.
You know, I don't get it. What exactly are you trying to blame for this
problem? Smarty is working exactly as specified in the documentation --
prefilters are only supposed to run when the template is recompiled.
They have nothing to do with cache.
-Andrei
"The only true currency in this bankrupt world is what we share with
each
other when we're uncool." -- Lester Bangs, from the film 'Almost Famous'
---
You are currently subscribed to smarty as: andreas.heintze@home.se
To unsubscribe send a blank email to $subst('Email.Unsub')
Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/