Welcome Guest, Not a member yet? Register   Sign In
routes and passing variables to controller
#1

[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!
#2

[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!




Theme © iAndrew 2016 - Forum software by © MyBB