Welcome Guest, Not a member yet? Register   Sign In
URL Parameter passing
#2

[eluser]Lyon[/eluser]
I don't think this can be done in CodeIgniter.
As I understand it each value separated by a slash is a parameter value. They do not have names.
In your example you would want :
Code:
function test_get()
{
    $user_type = $this->uri->segment(3, 'default value');
    $user_id = $this->uri->segment(5, 'default_value');
    echo $user_type;
    echo $user_id;
}
Or most likely you would remove the user section :
http://localhost/devit/users/test/12/123
Then use uri->segment(4, 'default_value'); for the user_id.

The uri class documentation may be of use to you.

Hope it helps.


Messages In This Thread
URL Parameter passing - by El Forum - 07-22-2010, 06:58 PM
URL Parameter passing - by El Forum - 07-23-2010, 02:28 AM
URL Parameter passing - by El Forum - 07-23-2010, 02:38 AM
URL Parameter passing - by El Forum - 07-23-2010, 03:14 AM
URL Parameter passing - by El Forum - 07-23-2010, 03:19 AM
URL Parameter passing - by El Forum - 07-26-2010, 11:29 AM
URL Parameter passing - by El Forum - 07-27-2010, 12:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB