X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/ee06f37b0f6f6d94cd05a6ffae556660f7c4a2bc..c930e9176a5a85509c5b0230e2bff5c22a591432:/examples/writer/remote/lib/application_controller.php diff --git a/examples/writer/remote/lib/application_controller.php b/examples/writer/remote/lib/application_controller.php new file mode 100644 index 00000000..05403d02 --- /dev/null +++ b/examples/writer/remote/lib/application_controller.php @@ -0,0 +1,44 @@ +request = $request; + $this->id = $request->id; + $this->params = $request->params; + + if ($request->isRestful()) { + return $this->dispatchRestful(); + } + if ($request->action) { + return $this->{$request->action}(); + } + + // normal dispatch here. discover action + } + + protected function dispatchRestful() { + switch ($this->request->method) { + case 'GET': + return $this->view(); + break; + case 'POST': + return $this->create(); + break; + case 'PUT': + return $this->update(); + break; + case 'DELETE': + return $this->destroy(); + break; + } + } +} +