Cakephp URL参数检索()

时间:2014-06-30 11:35:13

标签: cakephp-2.0 parameter-passing response payment

如何使用我的cakephp控制器从支付站点检索响应密钥?

主要问题是我收到了来自付款整合网站的回复密钥以及\ /+%&等特殊字符。 在执行如下链接时,我收到“找不到页面”错误。

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

如何在控制器函数中将响应键作为传递参数获取?

1 个答案:

答案 0 :(得分: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;
}