我已經開發了帶有Zf2和DynamoDB的API,我可以從本地機器中獲取GET參數的值,但是當我上傳API的生產 時無法從GET參數獲取值。 供參考:POST方法在生產中正常工作。無法在生產中獲取參數
下面是控制器獲取功能。
public function get($id)
{
$abcModel = new ABCModel();
error_log("tournamentId:".$this->params()->fromQuery('tournamentId'));
$query = $this->getRequest()->getQuery();
error_log("tournamentId1:".$query['tournamentId']);
error_log("tournamentId2:".$this->getEvent()->getRouteMatch()->getParam('tournamentId'));
error_log("tournamentId3:".$this->params('tournamentId'));
error_log("tournamentId4:".$this->params()->fromRoute('tournamentId'));
}
我試過這個問題的所有答案ZF2: Get url parameters in controller。
任何人都知道可能是什麼原因嗎?
路上的任何燈光都會有幫助。
爲什麼人們希望得到一個答案而不會顯示導致問題的代碼? :S – Sam
@sam請看看.. –
也需要調試信息。像'var_dump($ request-> getQuery(),$ _GET)' – Sam