Remap function for codeigniter esque framework

February 18, 2011

Adding this function to any controller will enable your application to pass URI parameters to the index function. Which currently it will not do by default.

function _remap($method){
    if (method_exists($this, $method)){
        $this->$method();
    }else {
        $this->index($method);
    }
}

About me

Hello! I'm David Heward, how are you going? I'm a Senior Devops/Build Engineer, specialising in AWS & Cloud Automation. Based in London. Strong 10+ year background in Software development. Have a read of my blog. Have a look at some of my working projects. Contact me at @davehewy or on Linkedin.