Welcome Guest, Not a member yet? Register   Sign In
Load a controller into another controller
#3

Loading a controller from another controller breaks the MVC pattern and generally isn't the best practice. Controllers are really just supposed to pick which data you're displaying from your back end and sending it to your frontend.

I'd recommend writing a few services or libraries and moving all that facebook code in there. Then when you have that, call the library/service from your controller. This makes it so that you can pull that library from anywhere fairly easily, and makes it so that you can unit test each library and mock out your api calls.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply


Messages In This Thread
RE: Load a controller into another controller - by albertleao - 08-13-2019, 08:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB