Welcome Guest, Not a member yet? Register   Sign In
CI - 2 issues while extending core classes
#1

[eluser]fajnalowiec[/eluser]
so, I wanted to extend 2 native CI 2.0.1 classes: Input & Controller.
In the help file, both of them are stated as core classes:
http://ellislab.com/codeigniter/user-gui...asses.html
According to manual, these classes files should be put in the app/core dir, but, when I follow the instruction the error occured 'Unable to load the requested class: ...'.
If I put MY_Input.php (class MY_Input extends CI_Input) in app/libriaries everything would goes well.
A little bit different story with extending native controller. The same error when I follow the help file, but if I put MY_Pre.php (class MY_Pre extends CI_Controller) in app/core and paste this function into app/config/config.php:

function __autoload($class) {
if (strpos($class, 'CI_') !== 0) {
@include_once(APPPATH . 'core/' . $class . EXT);
}
}

I am able to inherit controlers from MY_Pre. The function is also mentioned in this topic:
http://ellislab.com/forums/viewthread/183648/

Maybe these would be helpful to other coders and I hope they fix it in next CI version.
#2

[eluser]InsiteFX[/eluser]
For one Phil has updated the __autoload! search for it.

You must being doing something wrong because I have no problems extending core classes!

Now if you post this in the correct forum topic and not here where NO CODE is allowed I could have posted the new code!

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB