|
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 |
martyf Smarty Rookie
Joined: 20 Oct 2010 Posts: 13
|
Posted: Thu Dec 02, 2010 7:59 am Post subject: Function plugin, and nocache |
|
|
Excuse me if this is a really noob question, but I've just started writing plugins for Smarty 3.
I've written functions, and everything works a treat.
I was then looking for a way to make a function call not be cached (i.e. run as an insert, not an include).
I saw lots of posts about using {nocache}...{/nocache} but thought that seemed a little over the top... I recalled seeing somewhere someone use a function call like:
{helloWorld nocache}
So I thought I'd give it a go - create a simple HelloWorld function that outputs the current time.
Running two calls - one with "nocache" and one without, it behaves as expected - the one without "nocache" is cached.
So - my question is - am I missing something obvious about using "nocache" in this way (is it bad or not recommended something)? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Dec 02, 2010 5:39 pm Post subject: |
|
|
It's save to use {helloWorld nocache}.
This new option is not yet in documentation. |
|
Back to top |
|
martyf Smarty Rookie
Joined: 20 Oct 2010 Posts: 13
|
Posted: Thu Dec 02, 2010 9:14 pm Post subject: |
|
|
Fantastic - thanks for the clarification |
|
Back to top |
|
tron2k Guest
|
Posted: Thu Dec 02, 2010 11:50 pm Post subject: |
|
|
U.Tews wrote: | It's save to use {helloWorld nocache}.
This new option is not yet in documentation. |
hehe i just wanted to note that $smarty->assign("var",$value,true) wouldnt be in the docs, or that the nocache flags are missing in the cache section of the docs but that was all added today or so?
Good work! Thanks for all the effort you guys put into our most loved template engine. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Dec 03, 2010 12:01 am Post subject: |
|
|
Yes, we are still extending and improving documentation..... |
|
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
|