News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lorna Mitchell's Blog:
Building A RESTful PHP Server Output Handlers
February 01, 2012 @ 10:25:33

Lorna Mitchell is back with another post in her "Building a RESTful PHP Server" series today with this new post showing how to work with output handlers (her focus is on JSON).

So far we've covered parsing requests to determine exactly what the user is asking for, and also looked at routing to a controller to obtain the data or perform the action required. This post gives examples of how to return the data to the client in a good way.

She advocates using output handlers instead of the usual views you'd think of in a typical MVCish sort of application. The difference here is that there's not a lot of extra overhead to produce the results - it's literally an output directly from a class extending the base view (including the correct headers). She also briefly mentions the inclusion of JSONP functionality, allowing you to specify a local callback to execute when the request is returned. A few other "nice to haves" are also mentioned like the number of results returned and pagination support.

0 comments voice your opinion now!
output handler restful server json jsonp tutorial view


blog comments powered by Disqus

Similar Posts

IBM developerWorks: Intro to MVC Programming with Agavi, Part 1: Open a whole new world with Agavi

DevShed: Building an Error Logger with the Chain of Responsibility Pattern in PHP 5

Matthew Weier O'Phinney's Blog: View Layers, Database Abstraction, Configuration, Oh, My!

WebReference.com: Create a Localized Web Page with PHP

PHPWomen.org: Add values to a symfony form in between save() and serialization to the database


Community Events











Don't see your event here?
Let us know!


component hhvm symfony2 unittest application overview code framework introduction language podcast release package install example facebook hack opinion composer security

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework