diff --git a/backend/lib/Dispatcher.php b/backend/lib/Dispatcher.php index bebdbae..e796f81 100644 --- a/backend/lib/Dispatcher.php +++ b/backend/lib/Dispatcher.php @@ -114,7 +114,7 @@ class Dispatcher { * execute application */ public function run() { - $action = ($this->view->request->getParameter('action')) ? 'get' : $this->view->request->getParameter('action'); // default action + $action = ($this->view->request->getParameter('action')) ? strtolower($this->view->request->getMethod()) : $this->view->request->getParameter('action'); // default action $this->controller->run($action); // run controllers actions (usually CRUD: http://de.wikipedia.org/wiki/CRUD) diff --git a/backend/lib/View/HTTP/Request.php b/backend/lib/View/HTTP/Request.php index ac4eb07..06f4ac3 100644 --- a/backend/lib/View/HTTP/Request.php +++ b/backend/lib/View/HTTP/Request.php @@ -39,7 +39,7 @@ class Request { * * @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html */ - public $method; + protected $method; /** * constructor @@ -63,7 +63,7 @@ class Request { * setter & getter */ public function getHeader($header) { return $this->headers[$header]; } - + public function getMethod() { return $this->method; }; public function getParameter($name, $method = 'get') { return (isset($this->parameters[$method][$name])) ? $this->parameters[$method][$name] : NULL; }