CodeIgniter Forums
codeigniter as cms - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived General Discussion (
+--- Thread: codeigniter as cms (/showthread.php?tid=27530)

codeigniter as cms - El Forum - 02-13-2010

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 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.


codeigniter as cms - El Forum - 02-13-2010

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.