Welcome Guest, Not a member yet? Register   Sign In
Hooks on controller methods
#2

Why not create a MY_Controller and extend all your controllers from it?

Place all your code that is duplicated in to the MY_Controller.

If you are extending the Controller core class, then be sure to extend your new class in your application controller’s constructors.


PHP Code:
class Welcome extends MY_Controller {

        public function index()
        {
                $this->load->view('welcome_message');
        }


Place all your code that you need in every controller into the MY_Controller.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
Hooks on controller methods - by milengardev1994 - 10-11-2019, 02:06 PM
RE: Hooks on controller methods - by InsiteFX - 10-12-2019, 04:10 AM
RE: Hooks on controller methods - by InsiteFX - 10-12-2019, 11:33 AM
RE: Hooks on controller methods - by dave friend - 10-12-2019, 01:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB