php - index Routing CodeIgniter with many Parameters -


i have link example.com/entertainment/cinema/200

i want values link base on codeignitor controller

my default controller news

class news extends ci_controller { public function index($p1="",$p2="",$p3="") {     echo $p1,$p2,$p3; } function _remap($p1,$p2,$p3){      $this->_index($p1,$p2,$p3); } 

i want access www.example.com/entertainment/cinema/774/

but can echo $p1 how todo ?

you can use uri routing

try using this:

$route['news/(:any)/(:any)/(:any)'] = 'news/index'; 

now can have url this:

example.com/news/entertainment/cinema/774 

for additional info. got page:

http://www.codeigniter.com/userguide3/general/routing.html

but can access param without using uri routing set url this:

 example.com/news/index/entertainment/cinema/774 

you need add index between controller name(class) , parameters, ci know trying access index method in controller(news).


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -