Welcome Guest, Not a member yet? Register   Sign In
codeigniter as cms

Hi, I have this problem with codeigniter uri.

I wanted my uri to be like these:


instead of these


I wanted to pull the data for each page from the default controller like this

function index($slug){
$data['content'] = $this->pagemodel->_get_page($slug);

I also have these in my routes

$route['page:any'] = "page/index/$1";

For example if I go to this page domain.com/about-us but did not create a controller for it, Codeigniter returns a 404.

It would really be nice if Codeigniter checks for methods in the default controller if the controller for the page does not exist.


For my own pages controller I run everything through one method named "_remap()" where I then apply my page handling logic.

It removes the need for "index".

Hopefully that helps - _remap() is in the user guide.

Theme © iAndrew 2016 - Forum software by © MyBB