2014-06-30 90 views
0

如何使用我的cakephp控制器從付款站點檢索responsekey?Cakephp URL參數檢索()

主要問題是,我收到付款集成站點的回覆密鑰,其中包含特殊字符,如\ /+%&等。 執行類似以下的鏈接時,出現'找不到頁面'錯誤。

domain.com/Controller/action/reskey:IXcJUEkT//rGWiqllgOmJcw1P1CW362ZMAkoSMPHM+SMppkWVKzxLg+/m1VNUAKwrQ1+lfcJkQEnyp0nb/+D1ur

我怎樣才能得到響應的關鍵在我的控制器功能的傳入的參數?

回答

1

試試這個:

public function key(){ //change the key action name yo your action 

    //$this->params->url will result to domain.com/Controller/action/reskey:IXcJUEkT//rGWiqllgOmJcw1P1CW362ZMAkoSMPHM+SMppkWVKzxLg+/m1VNUAKwrQ1+lfcJkQEnyp0nb/+D1ur 

    list($url,$reskey) = split(":",$this->params->url); //split via ":" 
    debug($reskey); //returns to 'IXcJUEkT//rGWiqllgOmJcw1P1CW362ZMAkoSMPHM+SMppkWVKzxLg+/m1VNUAKwrQ1+lfcJkQEnyp0nb/+D1ur' 
    exit; 
}