Automatic configuration of URL in CodeIgniter

In this mini-post we are going to explain how to configure our CodeIgniter in order to make it run on any server without having to be modifying the parameter “base_url” in the configuration. So, we can move our development version of our site to another different server (let’s say, the production server), without worrying about this parameter.

Inheritance between controllers in Codeigniter

Today, we will talk about the inheritance between controllers in CodeIgniter. At first glance, it could seem very simple to do and it should not be more complicated than this:

class Parent_controller extends Controller {

    function __construct()
    {
       parent::Controller();
       ...
    }
    ...
}

class Child_controller extends Parent_controller {
    function __construct()
    {
        parent::__construct();
        ...
    }
    ...
}

If we run this code as it is, CodeIgniter will return an error saying that it can not find Parent_controller class, which I founded quite surprising. […]