I’m trying to capture slashes from a url and pass them into my controller. Here’s an example of my problem:
Let’s say I GET http://localhost/here/is/an/example where my route looks like:
$routes['here/is/(:any)'] = 'my_controller/$1';
and I have the following function definition in my_controller:
public function index($rest_of_the_path) {
...
}
I would like the value of $rest_of_the_path to be 'an/example', but it actually equals 'an'. How can I structure my code so I get what I want?
P.S.: I’m using Codeigniter 2.1.3
You can simply do this: