Open john-webb opened 9 years ago
I'm a bit confused with your examples id
in your routing is the same as uid
you are getting?
Please help me understand the situation better
Sorry for the confusing. So when I call
GET http://localhost/api/group/?uid=459&ukey=772f6ee7135efacd55f5
I expect the first case of the manual routing to be matched * @url GET / but instead the second case is matched and $id becomes the whole query string
/**
*
* @url GET /
* @url GET /{id}
* @return array
*/
protected function all($id = NULL) {
var_dump($id); //uid=459&ukey=772f6ee7135efacd55f5
return $this->db->formatSelect($this->db->all($_GET['uid']));
}
I would like to add my api class and map it to the empty string like so.
$r->addAPIClass('Group', '');
However when I do this my manual routing breaks in the class
This is because Restler now thinks that my authentication query string is a parameter to this method. If I add
@url GET /{id}
and then call
GET http://localhost/api/group/?uid=459&ukey=....
$id comes through as the query string. I can fix this by added a double forward slash // after group but I would like not to.