Welcome Guest, Not a member yet? Register   Sign In
Load controller from another controller
#4

(06-20-2019, 12:46 PM)Wouter60 Wrote: Did you think of using a library for that? Or create a MY_Controller.php in the application/core folder. Write a method to generate a common set of views or even different sets of views.
Let all your controllers (which are classes) extend the MY_Controller's class. Like that, you can use "common" methods in all your controllers.

I've tried this method and yeas it works! But i see a lot of people suggest not to do such thing like extending controllers in core folder. That's why i thought to ask for an alternative (in case there is one)!

//Life motto
if (sad() == true) {
     sad().stop();
     develop();
}
Reply


Messages In This Thread
RE: Load controller from another controller - by HarrysR - 06-20-2019, 12:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB