Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Using PHP functions inside plugins

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
luca200
Smarty Rookie


Joined: 05 Oct 2004
Posts: 13
Location: Bologna, Italy

PostPosted: Wed Dec 08, 2004 2:33 pm    Post subject: Using PHP functions inside plugins Reply with quote

Hi, I'm trying to write a plugin by myself, but it seems I need to use a php function inside it and it looks like others plugin don't do it (I did not look at all of them, actually Wink ).
What if I define one more function inside the function.pluginName.php file? Is there any naming convention about it?

Thanks Very Happy
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Dec 08, 2004 2:44 pm    Post subject: Reply with quote

Yes, the function name must be smarty_function_pluginName if you want Smarty to find it from the plugins directory. Defining other functions in the plugin file will not be used unless you call them specifically.
Back to top
View user's profile Send private message Visit poster's website
luca200
Smarty Rookie


Joined: 05 Oct 2004
Posts: 13
Location: Bologna, Italy

PostPosted: Wed Dec 08, 2004 3:05 pm    Post subject: Reply with quote

Seems like I did not explain the matter.... let's try again Very Happy (or could be I did not understand your answer...)

I have my smarty_function_pluginName function inside my function.pluginName.php file, and that's right. But I need one more function to call from smarty_function_pluginName. Is it right to define it inside the same php file? And how must I name it, if there's a rule about that?

Thanks again
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Dec 08, 2004 3:13 pm    Post subject: Reply with quote

There should be no problems creating other functions in the plugin file and calling them from the plugin. There is no naming convention that you must adhere to, aside from name collisions with other PHP functions. To be safe you could probably name it smarty_function_pluginName_helperfuncName
Back to top
View user's profile Send private message Visit poster's website
luca200
Smarty Rookie


Joined: 05 Oct 2004
Posts: 13
Location: Bologna, Italy

PostPosted: Wed Dec 08, 2004 3:26 pm    Post subject: Reply with quote

Fine, thanks!!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    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