HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How do I go about calling a function (method) in one plugin from another plugin.
default.php( of PluginOne) snippet.... class PluginOne extends Gdn_Plugin { public function test1($Sender) { // do something }
what would be the procedure (syntax) to call test1 from within PluginTwo default.php (of PluginTwo) class PluginTwo extends Gdn_Plugin { public function Testing ($Sender) { // call to test1 in pluginOne ??? what would be the correct syntax ??????????::test1($Sender); }
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
0
Comments
AFAIK, it is not possible unless:
I think the first option would be best (although I doubt there is a reference in $Sender). Otherwise I would extend the first plugin. It would be something along the lines of:
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
thanks @hgtonight
it gives me some ideas. I'll see what $Sender knows. I don't think option 2 is going to work the way I want to do things.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
You can call other plugins by using
Gdn::PluginManager()
.Simplest example:
My shop | About Me
.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@businessdad
perfecto, I learned something new today.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
You're welcome.
My shop | About Me