Probably, this sort of questions are asked before but those doesn't address my problem. Anyway, I'm using this routing settings in my applications/config/routes.php
file
$route['most-popular-movies-(:num)'] = 'movies/search/popular/$1';
where
Now, I want to get the two segments in my controller but it seams routing overwrites the segments and I'm just getting one segment i.e: most-popular-movies-1
when using $this->uri->segment_array()
Any Standard Solution?
EDIT:
I can use this method to split the URI inside my controller
explode('-', $this->uri->segment(1));
but this doesn't look to be a standard.
Like this. use uri_string()
.
$uri = $this->uri->uri_string();//most-popular-movies-1
$segments = explode('-',$uri);
//print_r($segments);.//array of segments
echo $segments[1];//output popular