OhD*_*ude 9 php cakephp cakephp-1.3 cakephp-2.0
在Codeigniter我这样做
$p=$this->input->post();
Run Code Online (Sandbox Code Playgroud)
发布所有对象但我不知道cakephp中是否有类似的东西从表单中获取所有发布的变量?我正在编写一个函数来获取发布的密码并将其保存到数据库中,而不是在那里记录的旧密码.
我使用本机php从表单中获取"发布"变量,(我不熟悉cakephp表单用法)这就是原因,所以我现在应该怎么做而不是使用$ _POST ['sssss']?
感谢您的任何帮助.
Bas*_*man 13
$value = $this->request->data('key');
Run Code Online (Sandbox Code Playgroud)
请进一步参考,请阅读手册.对自己来说,自己解决这个问题要简单得多.
http://book.cakephp.org/2.0/en/controllers/request-response.html#accessing-post-data
小智 6
for the GET method
$this->request->query['category-name'];
and POST method
$this->request->data
Run Code Online (Sandbox Code Playgroud)
http://book.cakephp.org/2.0/en/controllers/request-response.html#accessing-querystring-parameters