tags:

views:

105

answers:

2

example: verify.php?uid=5&token=TOKEN

the same as: verify/5/TOKEN

?

A: 

In Kohana "issuing a parameter via a URL" will show up as a parameter to your controller function. "Issuing a paramter via query strings" is available via the input library

If the parameter is core to the identity of your resource... keep it in the url. Example: www.example.com/our/presidents/Barack_Obama

Your controller code controllers/our.php

class Our_Controller {
    public function presidents($full_name)
    {
        ...
    }
}
Ozten
A: 

You could transform the 1st to the 2nd one by doing this

class Something_Controller {

    public function verify($uid, $token) {
        // whatever

    }


}

Otherwise you'd use the input library like so

$uid = $this->input->get('uid');

Depending on what settings you have in config/config.php, you may be automatically making it safe from XSS attacks.

alex
is there any siginificant difference between getting it via get and getting it via segments?
Not really - You just specify it differently. The arguments in the forward slash mapping become arguments to your method - however the GET vars function as expected.
alex

related questions