Welcome Guest, Not a member yet? Register   Sign In
how i can have a master Controller???I don't know
#1

I know CI has a main object that i can access using get_instance, but is it possible that run other controllers through one main controller?

we can use routing role to route all requests to Main_controller/Main_method, but in that method, how i can execute requested controllers?

wiredesignz HMVC has Modules::Run method, but is there a better way?
Reply
#2

Create a file called MY_Controller.php and put it in your application/core directory. Inside should be a class MY_Controller that extends CI_Controller. The class constructor should call parent::__construct();

Next, alter your controllers so they extend MY_Controller, not CI_Controller.

That's it.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB