uri->segment(0) return FALSE in _remap function |
[eluser]Zandy[/eluser]
Hi! I'm trying to extract the parameters in the _remap function, but the function uri->segment(0) I always returns false. Code: <?php the url in browser is http://localhost:8080/test/index.php/pru...eParameter should return "someParameter" ?? greetings
[eluser]llbbl[/eluser]
"someParameter" would be the 3rd segment of the URI. http://ellislab.com/codeigniter/user-gui...s/uri.html http://example.com/index.php/news/local/...rime_is_up The segment numbers would be this: 1. news 2. local 3. metro 4. crime_is_up By default the function returns FALSE (boolean) if the segment does not exist. There is an optional second parameter that permits you to set your own default value if the segment is missing. For example, this would tell the function to return the number zero in the event of failure: $product_id = $this->uri->segment(3, 0);
[eluser]llbbl[/eluser]
it's (3,0) but (3) should work also assuming your url is formatted like above /prueba/pru/someParameter
[eluser]sophistry[/eluser]
do a fresh CI install and try your _remap code again. something is wrong with your CI install if it doesn't have uri segments in the uri object. |
Welcome Guest, Not a member yet? Register Sign In |