mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
添加表单请求类型伪装支持 默认变量为 _method
This commit is contained in:
@@ -83,6 +83,8 @@ return [
|
||||
'url_controller_convert' => true,
|
||||
// 是否自动转换URL中的操作名
|
||||
'url_action_convert' => true,
|
||||
// 表单请求类型伪装变量
|
||||
'method_var' => '_method',
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 模板引擎设置
|
||||
|
||||
@@ -417,7 +417,12 @@ class Request
|
||||
$this->method = $method;
|
||||
return;
|
||||
} elseif (!$this->method) {
|
||||
$this->method = IS_CLI ? 'GET' : (isset($this->server['REQUEST_METHOD']) ? $this->server['REQUEST_METHOD'] : $_SERVER['REQUEST_METHOD']);
|
||||
$mask = $this->param(Config::get('method_var'));
|
||||
if ($mask) {
|
||||
$this->method = $mask;
|
||||
} else {
|
||||
$this->method = IS_CLI ? 'GET' : (isset($this->server['REQUEST_METHOD']) ? $this->server['REQUEST_METHOD'] : $_SERVER['REQUEST_METHOD']);
|
||||
}
|
||||
}
|
||||
return $this->method;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user