Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Storing data in static in my plugin

 
Post new topic   Reply to topic    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
firejocker
Smarty n00b


Joined: 10 Apr 2012
Posts: 2

PostPosted: Tue Apr 10, 2012 4:44 pm    Post subject: Storing data in static in my plugin Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5067
Location: Hamburg / Germany

PostPosted: Tue Apr 10, 2012 5:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
firejocker
Smarty n00b


Joined: 10 Apr 2012
Posts: 2

PostPosted: Tue Apr 10, 2012 5:16 pm    Post subject: Reply with quote

Shame on me Embarassed

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP