Skip to content

Commit 4cd56e4

Browse files
author
Kevin Wood-Friend
committed
Improved support for alternate HTTP methods
1 parent df11a54 commit 4cd56e4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

application/libraries/REST_Controller.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ public function __construct()
149149
$this->request = new stdClass();
150150
$this->request->method = $this->_detect_method();
151151

152+
// Create argument container, if nonexistent
153+
if ( ! isset($this->{'_'.$this->request->method.'_args'}))
154+
{
155+
$this->{'_'.$this->request->method.'_args'} = array();
156+
}
157+
152158
// Set up our GET variables
153159
$this->_get_args = array_merge($this->_get_args, $this->uri->ruri_to_assoc());
154160

@@ -174,7 +180,7 @@ public function __construct()
174180
}
175181

176182
// Merge both for one mega-args variable
177-
$this->_args = array_merge($this->_get_args, $this->_put_args, $this->_post_args, $this->_delete_args);
183+
$this->_args = array_merge($this->_get_args, $this->_put_args, $this->_post_args, $this->_delete_args, $this->{'_'.$this->request->method.'_args'});
178184

179185
// Which format should the data be returned in?
180186
$this->response = new stdClass();

0 commit comments

Comments
 (0)