|
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 |
luca200 Smarty Rookie
Joined: 05 Oct 2004 Posts: 13 Location: Bologna, Italy
|
Posted: Wed Dec 08, 2004 2:33 pm Post subject: Using PHP functions inside plugins |
|
|
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 ).
What if I define one more function inside the function.pluginName.php file? Is there any naming convention about it?
Thanks |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Dec 08, 2004 2:44 pm Post subject: |
|
|
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 |
|
luca200 Smarty Rookie
Joined: 05 Oct 2004 Posts: 13 Location: Bologna, Italy
|
Posted: Wed Dec 08, 2004 3:05 pm Post subject: |
|
|
Seems like I did not explain the matter.... let's try again (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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Dec 08, 2004 3:13 pm Post subject: |
|
|
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 |
|
luca200 Smarty Rookie
Joined: 05 Oct 2004 Posts: 13 Location: Bologna, Italy
|
Posted: Wed Dec 08, 2004 3:26 pm Post subject: |
|
|
Fine, 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
|