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

[eluser]fajnalowiec[/eluser]
The original topic I post was here:
http://ellislab.com/forums/viewthread/188809/
Can any of forum moderator delete it? Sorry for inconvienience, I post it in a wrong place.
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/

InsiteFX, I would be happy to do it in a proper way. So, if You know what' s wrong with my code, please let me know. As I mentioned earlier, I use CI v2.0.1.




Theme © iAndrew 2016 - Forum software by © MyBB