0
我有一個關於框架的問題。我基於您的現場示例中的我的CRUD。我有這個網址:Restler PHP API框架URL路由
http://mydomain.com/test/index.php/api/t1/module1/[email protected]?query1=mama&query2=papa
在我api.php文件,我對這個請求中使用GET方法:
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;
}
}
然後在我的control.php,
public function t1($numbers) {
print_r($numbers);
}
這是的響應正文是
陣列 ( [0] => T1 [1] =>模塊1 [2] => [email protected] [3] => )
我要實現在什麼這裏得到的值爲查詢1和查詢2?我怎樣才能做到這一點?
謝謝。
感謝您的答覆。它不起作用阿魯爾。我現在所做的是從** $ _ SERVER ['QUERY_STRING'] **獲取值,但對我來說不是最好的方法。 –
它工作正常!我已經用概念驗證測試並更新了我的示例。如果這不是你想要的,請告訴我 – Arul