[eluser]Lukas1[/eluser]
Hello, thanks for answer. I don't use CI Reactor, I use the stable version of CI.
I am not sure, you understand my problem well, after reading your answer. It seems to me, you think, that I am not able to create a Controller. This is not the case, I don't have any problems with that. I want to extend the core CI_Controller however, and let my controllers extend not the CI_Controller, but my extended Controller.
So for example, let's say, I want to have a Test_controller. If I would want to just create a controller I can do this
Code:
public class Test_controller extends CI_Controller {
public function index() {
//do something
}
}
This approach works for me. And this is, where URL is involved.
However I want for example to have every of my controller a function that will return some concrete value.. I don't know, for example HTML header.
So I want to do this:
in application/core/my_controller.php
Code:
public class MY_Controller extends CI_Controller {
protected function get_html_header() {
return '<head><title>Title of this page</title><'head>';
}
in application/controller/test_controller.php
Code:
public class Test_controller extends MY_Controller {
public function index() {
$htmlHeader = $this->get_html_header();
//do something
}
}
When I run this on my computer with Wamp Server, it works just as documented. However after uploading my CI project with this code, I get error:
Fatal error: Class ‘MY_Controller’ not found in [PATH]/application/controller/test_controller.php
So URL is correct, it's not a problem of wrong URL, it has absolutely nothing to do with it.
For now I have to manualy include my_controller.php to every of my controllers, if I want to have my project run on the server. I don't know why is this the case, why including application/core/my_controller.php fails...