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:
nate 2007-10-28 05:28:45 +00:00
parent fbd3811cd1
commit 7e9b05e429
5 changed files with 38 additions and 19 deletions

View file

@ -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'])) {