<?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>Fri, 24 May 2013 09:47:21 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Working with Slim Middleware]]></title>
      <guid>http://www.phpdeveloper.org/news/19213</guid>
      <link>http://www.phpdeveloper.org/news/19213</link>
      <description><![CDATA[<p>
On PHPMaster.com <i>Timothy Boronczyk</i> has <a href="http://phpmaster.com/working-with-slim-middleware/">written up a tutorial</a> about using the <a href="http://www.slimframework.com/">Slim microframework</a> as a sort of "middleware" in your application - a wrapper around other functionality with an easier to use interface.
</p>
<blockquote>
<a href="http://www.slimframework.com/">Slim is a microframework</a> that offers routing capabilities for easily creating small PHP applications. But an interesting, and powerful, feature is its concept of Middleware. [...] I've found middleware to be an eloquent solution for implementing various filter-like services in a Slim app, such as authentication and caching. In this article I'll explain how middleware works and share with you a simple cache example that highlights how you can implement your own custom middleware.
</blockquote>
<p>
He talks about what "middleware" is (complete with <a href="http://cdn.phpmaster.com/files/2013/02/middleware.jpg">illustration</a>) and how Slim can be used as a layer in the middleware stack. His example is a caching layer, based on Slim, that takes a request, checks the cache for it and returns it if it exists. If not, it saves the content to a database. He also includes code examples of how to use the "add" method to introduce your middleware libraries into the Slim application.
</p>
<p>
If you'd like more examples, the Slim project has <a href="https://github.com/codeguy/Slim-Extras/tree/master/Middleware">several middleware examples</a> provided in their "extras" github repository.
</p>]]></description>
      <pubDate>Thu, 21 Feb 2013 09:23:24 -0600</pubDate>
    </item>
  </channel>
</rss>
