I have a question regarding the framework. I based my CRUD on your live example. I have this URL:
http://mydomain.com/test/index.php/api/t1/module1/username@mail.com?query1=mama&query2=papa
In my api.php file, I used GET method on this request:
public function __construct(){
$this->dp = new Control();
}
public function get($id=NULL, $id2=NULL, $id3=NULL, $id4=NULL)
{
switch($id)
{
case "t1":
return $this->dp->t1(func_get_args());
break;
case "t2":
return $this->dp->t2(func_get_args());
break;
default:
throw new RestException(400);
break;
}
}
Then on my control.php,
public function t1($numbers) {
print_r($numbers);
}
The response body of this is
Array
(
[0] => t1
[1] => module1
[2] => username@mail.com
[3] =>
)
What I want to achieve in here is get the values of query1 and query2? How can I do this?
Thanks.
I have created the following proof of concept and tested it and made sure it works!
For hosting the API above I use the following index.php (gateway)
When I call
or
or
I get
So I should be able to pass it to another class another method easily