Joseph Crawford’s Blog: Zend Framework: Creating RESTful Applications

March 11, 2010

Zend Framework

Joseph Crawford has a new post to his blog today with a look at his use of the Zend_Rest_Controller and Zend_Rest_Route components of the Zend Framework to create a simple REST service.

You might be asking yourself why do I have to use both components, why is it not rolled into one nice component. The answer is really basic and if you look at the source code for the Zend_Rest_Controller you will see that it is solely an abstract class that defines the methods required for use with the Zend_Rest_Route.

He includes the code to add to your bootstrap file to get the routing working and a sample controller (MyController) that extends the Zend_Rest_Controller and sets up some basic actions – get, put, post and delete. He does mention one issue he’s coming across in a feature he’s wanting to add – putting the version number of the API in the URL for easier separation.

This content syndicated from
PHPDeveloper.org.
Visit the
original content
for more commentary.

One Response to “Joseph Crawford’s Blog: Zend Framework: Creating RESTful Applications”

  1. venkatadry Says:

    SELECT * FROM emp WHERE ename=’smith’ AND id=520

    please tell me how to implement this qury in zend frame work