We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Can anybody help me to load an instance from another plugin | Forum

Vipin
Vipin Jul 23 '13
Please any body help me to sort out this. I want to load an BOL instance from  a plugin to another plugin how can i  achieve this, What i have done is given below but didn't worked!


$this->coverphoto = OW::getPluginManager()->getPlugin('coverphoto');  // coverphoto plugin 
$this->coverphotoService = COVERPHOTO_BOL_CoverphotoService::getInstance(); 


Thanks in  advance!.




The Forum post is edited by Vipin Jul 23 '13
ross Team
ross Jul 23 '13
Topic was moved from General Questions.
Daisy Team
Daisy Aug 1 '13
Vipin, all depends on what exactly you want to achieve. But if you want to load the third-party plugin instance you have to check if this plugin is active. Here is an example of the code you should use:

if ( OW::getPluginManager()->isPluginActive("coverphoto") )
        {
            $this->coverphoto = OW::getPluginManager()->getPlugin('coverphoto');  // coverphoto plugin 
            $this->coverphotoService = COVERPHOTO_BOL_CoverphotoService::getInstance();
            
            // Code ...
        }
Vipin
Vipin Aug 4 '13
Thank You for the reply it is sorted!  


and have another question.. how can apply a custom  masterpage layout from  the theme to a module?
like $this->setLayout('template name') 

Also where can i find the complete class & function reference or documentation of oxwall?



Daisy Team
Daisy Aug 8 '13

Quote from Vipin how can apply a custom masterpage layout from the theme to a module? like $this->setLayout('template name')

Please take a look at the explanation on how to do that here: http://www.oxwall.org/forum/topic/11669?page=1#post-59495


Quote from Vipin Also where can i find the complete class & function reference or documentation of oxwall?


You can check out our crash course to see how the plugin forms, classes and components work here: http://docs.oxwall.org/dev:crash-course

If you have the specific questions, please do not hesitate to ask, we will do our best to assist you.