Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4797

Getting parameters from Zend rest controllers processing it and returning data to the controllers

$
0
0

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


Viewing all articles
Browse latest Browse all 4797

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>