Jump to content

Create several controllers inside module


Nadjib BELLOUNDJA

Recommended Posts

Hi everybody,

 

Once I get this tab, I would like to have changes that are specific to a category and others that are specific to the produt. I would like each of this changes to be handled by different controllers.

 

My question is when and how do I call other controllers within my hookDisplayAdminProductsExtra($params) function.

My function is currently:

 

public function hookDisplayAdminProductsExtra($params)
{
        // I WOULD LIKE TO CALL MY CONTROLLERS IN THE module_folder/controllers/admin AND MAKE THEM CALL THE FOLLOWING PAGE
       return $this->display(__FILE__, 'stampcustom_admin_tab.tpl');
}

 

Thanks.

Link to comment
Share on other sites

include this controller file to your code with require_once 'yourcontroller.php'

then if you've got non static function call it with:
YourController=new YourControllerName();

YourController->callYourFunction();

if you've got static function you can call it with:

YourControllerName::CallYourFunction();

  • Like 1
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...