php - Routing with codeigniter - ID not passed -


i've picked codeigniter fun little side project, i'm trying make routes follows;

http://localhost/c/show/id  

should translate into

http://localhost/c/id 

i in routes in config so;

$route['c/:any'] = "c/show/$1"; 

however, id passed plaintext, means id passed show() function $1, , not whatever id set to.

am going wrong? i've looked around in documentation , tried copy&replace make sure it's not typed wrong.

now fear might have missunderstood cannot phatom be.

really grateful , help!

":any" should in brackets, this:

$route['c/(:any)'] = "c/show/$1"; 

btw if id numeric, it's better use:

$route['c/(:num)'] = "c/show/$1"; 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -