Php $this->;请求->;param()和$this->;请求->;kohana 3.2中的post()
kohana 3.2中的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获
$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