Welcome Guest, Not a member yet? Register   Sign In
Controller Inheritance/Extending
#9

[eluser]Colin Williams[/eluser]
Quote:Sorry for kind of offtopic, but I also thought that include() is somewhat unrecommended/not-CI-way. And used helpers/libraries instead.

It's an odd perception that a lot of people have. It would be bad practice to use it in place of an existing CI method that is better equipped to perform the given action.

Quote:Note that you can put your Shop class in MY_Controller.php in your application/libraries folder and it will be automatically loaded by the CI engine.

True. But he obviously has an array of methods in his Shop controller. It wouldn't be practical to move this into MY_Controller.php. I don't get how it makes sense to bend over backwards just to avoid using the include() statement. Essentially, you end up hunting for files that CI include()s itself.

Including the shop.php controller is the absolute, most practical way to go about it.


Messages In This Thread
Controller Inheritance/Extending - by El Forum - 01-18-2009, 03:12 PM
Controller Inheritance/Extending - by El Forum - 01-18-2009, 03:50 PM
Controller Inheritance/Extending - by El Forum - 01-19-2009, 01:38 AM
Controller Inheritance/Extending - by El Forum - 01-19-2009, 03:18 AM
Controller Inheritance/Extending - by El Forum - 01-19-2009, 07:06 AM
Controller Inheritance/Extending - by El Forum - 01-19-2009, 07:20 AM
Controller Inheritance/Extending - by El Forum - 01-19-2009, 08:02 AM
Controller Inheritance/Extending - by El Forum - 01-19-2009, 10:47 AM
Controller Inheritance/Extending - by El Forum - 01-19-2009, 11:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB