|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Wom.bat Smarty Pro
Joined: 24 Apr 2003 Posts: 107 Location: Munich, Germany
|
Posted: Sat Apr 26, 2003 8:55 pm Post subject: post-2.5.0-cvs: outputfilters don't work on cached templates |
|
|
hi folks...
I don't like {insert}s, because they are rather slow, but I needed to display the number of comments on news. As the news are cached, I used a replacer token (sth like #replacer-comments-news-id#) and let an outputfilter run over it.
This always worked perfect until now: it now seems that the output filter gets cached, too.
I use one template index.tpl in which I include the rest of the site (php files, not templates directly) via include_php. all php files are using the same smarty object. in the php files, I enable or disable caching and then display the template.
Maybe I'm doing something in the wrong way, if so, please let me know...
-edit-
well... issue solved, close please |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Sun Apr 27, 2003 4:18 am Post subject: |
|
|
Wom.bat:
I see that you have the issue solved, but I was wondering if you can give more details on the issue and how it was solved. I've been having a hard time getting some new functionality to work with the caches in the way I expect them to under 2.5CVS. Perhaps you've learned something that can be helpful to me too
Unless you weren't clearing the caches, that won't help me
Thanks! |
|
Back to top |
|
Wom.bat Smarty Pro
Joined: 24 Apr 2003 Posts: 107 Location: Munich, Germany
|
Posted: Sun Apr 27, 2003 10:37 am Post subject: |
|
|
clearing the caches wouldn't make sense, that exactly what I wanted to avoid, as comments are posted quite often
I really don't have a clue why I was thinking that this had once worked... maybe because I wasn't using one smarty object for templates like now.
I now do just a fetch() on the index.tpl and then let the output run through some filters manually (I don't use outputfilters via smarty anymore)
echo outputFilters($smarty->safeFetch("index.tpl"));
safeFetch (like safeDisplay) sets caching to false after displaying the template (so that I can have some templates cached, and some not) clears all assigns done (via safeAssign) to the template after displaying it, as I am using one smarty object everywhere in this application, and so I would have $foo from foo.tpl in bar.tpl, too. note that $smarty is a "class MySmarty extends Smarty" object |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|