CodeIgniter Forums

Full Version: loading a controller function in another controller function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
let suppose i have a controller Controller_A and it's function A and another Controller_B and it's function is B

can i call function A of Controller_A from inside the Controller_B function B

El Forum

[eluser]TWP Marketing[/eluser]
Rethink what you want to do.
You have the same function which is performed by two different controllers.
Move this function to a model and load that model in each controller.
Avoid the duplication of code.

El Forum

[eluser]CroNiX[/eluser]
Sounds like a great place to use a library.