CakePHP 从 this->params 中删除特殊字符
我正在使用 jQuery 将数据传递到 cakephp 1.2 应用程序中的以下 URL:
$("#test").load("http://domain.com/controller/action/productID:2001642/questionID:2501322/value:C%2B%2B/questionType:3", function({
$("#test").fadeOut(3000);
});
在控制器中,当我
debug($this->params['named']);
返回
Array
(
[productID] => 2001642
[questionID] => 2501322
[value] => C
[questionType] => 3
)
时$this 的 URL 部分显示
[url] => Array
(
[url] => deu/productanswers/updateoredit/productID:2001642/questionID:2501322/value:C /questionType:3
)
,以便沿线的某个位置 C++ 或 C%2B%2B 被压扁。
请问有人有解决方案或解决方法吗?
干杯, 塔夫
I am using jQuery to pass data to the following URL in my cakephp 1.2 app:
$("#test").load("http://domain.com/controller/action/productID:2001642/questionID:2501322/value:C%2B%2B/questionType:3", function({
$("#test").fadeOut(3000);
});
In the controller when I
debug($this->params['named']);
it returns
Array
(
[productID] => 2001642
[questionID] => 2501322
[value] => C
[questionType] => 3
)
The URL part of $this displays
[url] => Array
(
[url] => deu/productanswers/updateoredit/productID:2001642/questionID:2501322/value:C /questionType:3
)
so that somewhere along the line the C++ or C%2B%2B is getting squished.
Does anyone have a solution or workaround please?
Cheers,
Taff
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然我对 cakephp 解决方案非常感兴趣,但我诉诸于使用 $_SERVER['REQUEST_URI']
绝对不是一个性感的解决方案
希望这对将来的人有帮助......
Although I would be very interested in a cakephp solution, I resorted to using $_SERVER['REQUEST_URI']
Definitely not a sexy solution
Hope this helps someone in the future...