mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-03 10:02:42 +00:00
Adding hidden form inputs for REST routing
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5913 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
fbd3811cd1
commit
7e9b05e429
5 changed files with 38 additions and 19 deletions
|
@ -349,6 +349,14 @@ class Dispatcher extends Object {
|
|||
} else {
|
||||
$params['form'] = $_POST;
|
||||
}
|
||||
if (isset($params['form']['_method'])) {
|
||||
if (isset($_SERVER) && !empty($_SERVER)) {
|
||||
$_SERVER['REQUEST_METHOD'] = $params['form']['_method'];
|
||||
} else {
|
||||
$_ENV['REQUEST_METHOD'] = $params['form']['_method'];
|
||||
}
|
||||
unset($params['form']['_method']);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($params['form']['data'])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue