zend-rest

Zend Framework 1.9.2+ Zend_Rest_Route Examples

我是研究僧i 提交于 2021-02-06 09:19:12
问题 With the introduction of Zend_Rest_Route in Zend Framework 1.9 (and its update in 1.9.2) we now have a standardized RESTful solution for routing requests. As of August 2009 there are no examples of its usage, only the basic documentation found in the reference guide. While it is perhaps far more simple than I assume, I was hoping those more competent than I might provide some examples illustrating the use of the Zend_Rest_Controller in a scenario where: Some controllers (such as

How to set up Hierarchical Zend Rest Routes?

↘锁芯ラ 提交于 2019-12-29 03:33:36
问题 With the Zend Framework, I am trying to build routes for a REST api on resources organized in the following pattern: http://example.org/users/ http://example.org/users/234 http://example.org/users/234/items http://example.org/users/234/items/34 How do I set up this with Zend_Rest_Route? Here is how I have setup the route for the users resource (users/:id) in my bootstrap.php file: $this->bootstrap('frontController'); $frontController = Zend_Controller_Front::getInstance(); $restRoute = new

Examples on Zend_Rest_Controller Unit Testing

我们两清 提交于 2019-12-23 03:22:23
问题 I have found a bunch of examples how to unit test Zend_Controller, but I'm looking for examples on Zend_Rest_Controller Unit Testing. Any help is really appreciated. Thank you! 回答1: So, basically your question is how to emulate calling PUT and DELETE in your controller tests? Since this apparently doesn't work: $this->request->setMethod('PUT'); You can access both these actions with plain HTTP POST by providing _method parameter. So to call PUT : $this->request->setMethod('POST'); $this-

Examples of building a REST API server using Zend Framework?

主宰稳场 提交于 2019-12-04 16:39:52
问题 I'm new to Zend Framework (not to PHP), and I need to create a REST based API using Zend. I've seen examples using Zend_Rest_Server, however other sources state that that has been deprecated. I'm unable to find a solid example which shows how I should be building such an API. 回答1: Zend_Rest_Server is indeed deprecated since ZF 1.9, you should use Zend_Rest_Controller instead. The following blog posts could be helpful : Building RESTful Services with Zend Framework and Create RESTful

Examples of building a REST API server using Zend Framework?

不打扰是莪最后的温柔 提交于 2019-12-03 10:45:52
I'm new to Zend Framework (not to PHP), and I need to create a REST based API using Zend. I've seen examples using Zend_Rest_Server, however other sources state that that has been deprecated. I'm unable to find a solid example which shows how I should be building such an API. Zend_Rest_Server is indeed deprecated since ZF 1.9, you should use Zend_Rest_Controller instead. The following blog posts could be helpful : Building RESTful Services with Zend Framework and Create RESTful Applications Using The Zend Framework . May be this link would be helpful: Creating a PHP REST API Using the Zend

How to set up Hierarchical Zend Rest Routes?

耗尽温柔 提交于 2019-11-28 18:59:08
With the Zend Framework, I am trying to build routes for a REST api on resources organized in the following pattern: http://example.org/users/ http://example.org/users/234 http://example.org/users/234/items http://example.org/users/234/items/34 How do I set up this with Zend_Rest_Route? Here is how I have setup the route for the users resource (users/:id) in my bootstrap.php file: $this->bootstrap('frontController'); $frontController = Zend_Controller_Front::getInstance(); $restRoute = new Zend_Rest_Route($frontController); $frontController->getRouter()->addRoute('default', $restRoute); [As