<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 22 May 2013 21:48:30 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Enrise.com: REST Style Context Switching - Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/15736</guid>
      <link>http://www.phpdeveloper.org/news/15736</link>
      <description><![CDATA[<p>
<i>Joshua Thijssen</i> has written up a new post for the Enrise blog today about <a href="http://www.enrise.com/2011/01/rest-style-context-switching-part-2/">using REST-style context switching</a> in Zend Framework applications with the help of a handy "RestContextSwitch" helper.
</p>
<blockquote>
In the <a href="http://www.enrise.com/2010/12/rest-style-context-switching/">first part</a> of this blog post we've talked about the theory behind REST services. In this post we put the theory into practice with the help of some code snippets you can implement in your own application.
</blockquote>
<p>
He starts by helping you create a simple REST controller (well, cut-and-pasteable code, really) that can handle multiple output formats/contexts - XML, JSON and HTML. Next up is the helper (Service_Controller_Action_Helper_RestContextSwitch) that's not much different than the normal context switching helper. With that in place he moves on to the plugins - an accept-hander that sets the correct format based on the Accept HTTP header information and a media-format plugin to check "permissions" on the context to see if that type is allowed in that environment.
</p>]]></description>
      <pubDate>Thu, 13 Jan 2011 12:48:57 -0600</pubDate>
    </item>
  </channel>
</rss>
