Add API methods to add POST/DELETE routes to the API

This commit is contained in:
Toby Zerner 2015-08-02 17:26:30 +09:30
parent 52125ce84c
commit 262cfb84f0

View File

@ -24,11 +24,21 @@ class RegisterApiRoutes
$this->route('get', $url, $name, $action); $this->route('get', $url, $name, $action);
} }
public function post($url, $name, $action)
{
$this->route('post', $url, $name, $action);
}
public function patch($url, $name, $action) public function patch($url, $name, $action)
{ {
$this->route('patch', $url, $name, $action); $this->route('patch', $url, $name, $action);
} }
public function delete($url, $name, $action)
{
$this->route('delete', $url, $name, $action);
}
protected function route($method, $url, $name, $action) protected function route($method, $url, $name, $action)
{ {
$this->routes->$method($url, $name, $this->action($action)); $this->routes->$method($url, $name, $this->action($action));