We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

how to access a 3rd party module from a custom extension?

Development and Programming

David Hyland's avatar
David Hyland
210 posts
15 years ago
David Hyland's avatar David Hyland

hi there. i’m creating a custom extension to perform some custom processing but I need to access a couple of functions within a 3rd party module.

how would i go about calling a modules functions from within an extension that’s not packaged within the same module?

thanks!

       
Jamie Rumbelow's avatar
Jamie Rumbelow
546 posts
15 years ago
Jamie Rumbelow's avatar Jamie Rumbelow

Accessing third party files are as easy as requiring them in your own add-on, instantiating the add-on’s class and calling one of the methods! You can use the PATH_THIRD constant to get the path to the expressionengine/third_party directory.

require PATH_THIRD . 'playa/mod.playa.php';

$playa = new Playa();
$playa->total_parents();
       
David Hyland's avatar
David Hyland
210 posts
15 years ago
David Hyland's avatar David Hyland

i thought it would be easy but it’s only easy when you know how!

thanks jamie!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.