|
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 |
firejocker Smarty n00b
Joined: 10 Apr 2012 Posts: 2
|
Posted: Tue Apr 10, 2012 4:44 pm Post subject: Storing data in static in my plugin |
|
|
Hi,
I starts with smarty so sorry if my question is a dumb one, but i'm wondering on to store data like i would do in a class as static in this kind of function :
Code: |
function smarty_function_storetest($params, $template){
$file = file_get_contents("........");
// how to store $file to get it without any process in a second call
} |
Thanks,
FJ |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Apr 10, 2012 5:06 pm Post subject: |
|
|
Code: | function smarty_function_storetest($params, $template){
static $file = null;
if (!$file) {
$file = file_get_contents("........");
}
// how to store $file to get it without any process in a second call
} |
|
|
Back to top |
|
firejocker Smarty n00b
Joined: 10 Apr 2012 Posts: 2
|
Posted: Tue Apr 10, 2012 5:16 pm Post subject: |
|
|
Shame on me
Thanks |
|
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
|