Jump to content

How to call another module's class and use its methods correctly?


Recommended Posts


Hello,
thank you in advance for your help. I do not know how to describe my problem. I need help creating the module A. Module A calls, for example: 

Quote

$topMenu = new Blocktopmenu(); 


How can I now use this class and send to my .tpl file (which I put in the hookFooter for example) the variables needed to create the menu? 

In other words - in my module I want to be able to use other modules (blocktopmenu / blocksearch / blockmyaccount). to add a sticky mini menu, for example, or to add a floating search button. How can I do it well and at the same time correctly?

P.S. I hope that I have explained it a bit comprehensibly :).

Edit:
Antonino, thank you for changing the background, it was not intended.

Edited by Matt Mikos
Background color removed by Antonino - #legibility (see edit history)
Link to comment
Share on other sites

Hello:

It depends on what you need. In general you can call any public method of Blocktopmenu or any other third party module you need, but you need to check what this methods do. If you need to get the HTML output result of the module you can call the corresponding method. If you just need to module set its smarty variables you can probably call the method but then you need to construct your own TPL and use that variables inside it. Again, all depends of what the third party module method do and what do you need exactly.

Regards

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...