Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php $this->;请求->;param()和$this->;请求->;kohana 3.2中的post()_Php_Mysql_Kohana_Kohana 3 - Fatal编程技术网

Php $this->;请求->;param()和$this->;请求->;kohana 3.2中的post()

Php $this->;请求->;param()和$this->;请求->;kohana 3.2中的post(),php,mysql,kohana,kohana-3,Php,Mysql,Kohana,Kohana 3,kohana 3.2中的$this->request->param()和$this->request->post()之间有什么区别 谁给我简单解释一下 谢谢你来到科哈纳 $data = $this->request->post(); // get $_POST data 返回post数据,如提交表单 $this->request->param() 返回POST以及从$\u POST和$\u get发送的get数据。参数在路由过程后获取分配给请求的请求参数,而POST获

kohana 3.2中的
$this->request->param()
$this->request->post()
之间有什么区别

谁给我简单解释一下

谢谢你来到科哈纳

$data = $this->request->post();
// get $_POST data
返回post数据,如提交表单

$this->request->param()

返回POST以及从$\u POST和$\u get发送的get数据。

参数在路由过程后获取分配给请求的请求参数,而POST获取发布的原始数据。

假设您有如下URL: 路由定义如下:

Route::set('books', '<controller>/<action>(/<product>(/<category>(/<author>)))')
        ->defaults(array(
            'controller' => 'store',
            'action' => '',
        ));
$this->request->post()
将返回
$\u post
数据

如果找不到密钥,这两种方法都将返回NULL:

$this->request->param('xxx') // NULL
$this->request->param('author') // martin_fowler
$this->request->post('id') // Some id value in $_POST or NULL if id doesn't exist in $_POST

参数包括get和post,其中post仅包括post变量谢谢您的信息。我了解$this->request->param()和$this->request->post()的工作原理。
$this->request->param('xxx') // NULL
$this->request->param('author') // martin_fowler
$this->request->post('id') // Some id value in $_POST or NULL if id doesn't exist in $_POST