CodeIgniter Forums
routes and passing variables to controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: routes and passing variables to controller (/showthread.php?tid=28275)



routes and passing variables to controller - El Forum - 03-06-2010

[eluser]Unknown[/eluser]
Hi, first post!

I'm having trouble with passing variables to my controller that contain a period in the value.

here's an example:

route:
$route['test/(:any)'] = "test/test_method/$1";

method is:
function test_method($val){
...
}

URL is domain.com/test/i.have.dots

the value that test_method receives is: i_have_dots

Why do the periods get replaced by underscores? and how do i change that!

Thanks!


routes and passing variables to controller - El Forum - 03-06-2010

[eluser]Unknown[/eluser]
nevermind!

The issue was in the url_protocol config

$config['uri_protocol'] = "AUTO"; chose the wrong place to get my value!

changing it to $config['uri_protocol'] = "REQUEST_URI"; fixed it.

hope this will help the next person with this issue!