api - Zend_Rest_Route for a specific controller -
i'm trying make zend_rest_route specific controller. want rest of site behave normally, except when particular controller (uploadapi) requested. think sytnax should follow, having hard time verifying. examples have modules, don't have module. correct?
protected function _initrestroute() { $this->bootstrap('frontcontroller'); $frontcontroller = zend_controller_front::getinstance(); $restroute = new zend_rest_route($frontcontroller, array(), array('default' => array('uploadapi'),)); $frontcontroller->getrouter()->addroute('rest', $restroute); }
the link here
http://weierophinney.net/matthew/archives/228-building-restful-services-with-zend-framework.html
gives examples modules, have no modules, , assuming "default" module name.
so have api functionality working , how looks. have add function in bootstrap class initilize zend_rest_route. zend rest api routing controllers listed in array, rest of site should work expected
protected function _initrestroute() { $this->bootstrap('frontcontroller'); $frontcontroller = zend_controller_front::getinstance(); $restrouteul = new zend_rest_route($frontcontroller, array(), array('default' => array('uploadapi', 'locationmatchesapi', 'getmatchesbyidapi', 'authapicontroller') )); $frontcontroller->getrouter()->addroute('rest', $restrouteul); }
Comments
Post a Comment