I am working on a restful zend-API frame work. The problem is, when a request is posted, i don't have the concept of how to get the data from the controllers into a separate class for processing and returning the processed output back to the controller. i.e the best way to implement the putAction function below
public function putAction() { $resource = $this->_getParam('resource'); $this->view->resource = $resource; //$requests = $this->getRequest(); switch (true) { case (strstr($resource, 'account')): $response = $this -> do_post_request($requests); $resource = "You are accessing account"; break; case (strstr($resource, 'property')): $response = $this -> do_post_request($requests); $resource = "You are accessing property"; break; case (strstr($resource, 'autos')): $response = $this -> do_post_request($requests); $resource = "You are accessing autos"; break; default: $resource = "The specified resource is not available please check the api manual for available resources"; break; } $this->view->message = $response; $this->_response->ok(); }where the response is collected after being processed by other functions in other classes. If i was to use the: $response = $this -> do_post_request($requests); how will the structure of the other classes be for them to process the request and produce the response