Welcome Guest, Not a member yet? Register   Sign In
Need urgent help - Common method for all controller
#11

[eluser]stevezissou[/eluser]
Yes, in hindsight I should have mentioned something about extending core classes within the 'core' folder. However, with that method you can run into problems when you have situations with multiple 'parent' controllers that all extend the main CI_Controller.
#12

[eluser]CroNiX[/eluser]
Unless you add an autoloader like this: http://philsturgeon.co.uk/blog/2010/02/C...ing-it-DRY

But this doesn't really have anything to do with the OPs question as he's not dealing with multiple extensions. He just needs the basic MY_Controller functionality mentioned in the userguide.
#13

[eluser]stevezissou[/eluser]
Quote:Unless you add an autoloader like this: http://philsturgeon.co.uk/blog/2010/02/C...ing-it-DRY

No disrespect to Phil, but that's somewhat on the hacky side. The exact same functionality can be handled with one line of code ('require_once') at the top of your controller file...and you don't need to modify the config.php file to have more responsibility beyond storing configuration params.

Quote:But this doesn’t really have anything to do with the OPs question as he’s not dealing with multiple extensions. He just needs the basic MY_Controller functionality mentioned in the userguide.

You are right. My original reply above was just addressing the error message the OP was receiving. Everything after would probably be better for a thread on laying out a CI project.




Theme © iAndrew 2016 - Forum software by © MyBB