<?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>Sun, 19 May 2013 20:44:25 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[NetTuts.com: Taming Slim 2.0]]></title>
      <guid>http://www.phpdeveloper.org/news/19396</guid>
      <link>http://www.phpdeveloper.org/news/19396</link>
      <description><![CDATA[<p>
On NetTuts.com today there's a new tutorial posted about <a href="http://net.tutsplus.com/tutorials/php/taming-slim-2-0/">"taming" Slim 2.0</a>, the latest version of the popular PHP microframework. They look at application structure and share some tips to using this update.
</p>
<blockquote>
<a href="http://www.slimframework.com/">Slim</a> is a lightweight framework that packs a lot of punch for its tiny footprint. It has an incredible routing system, and offers a solid base to work from without getting in your way. Let me show you! But that's not to say that Slim doesn't has some issues; it's one-file setup becomes cluttered as your application grows. In this article, we'll review how to structure a Slim application to not only sustain, but improve its functionality and keep things neat and systematic.
</blockquote>
<p>
He starts with an example of "vanilla Slim" and looks some at what's happening behind the scenes in the routing engine. They then give you a step by step installation and usage guide including updating the router to use class files. An example controller is included as well as some basic error handling using a Twig template for use across the application.
</p>]]></description>
      <pubDate>Tue, 02 Apr 2013 09:17:11 -0500</pubDate>
    </item>
    <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>
    <item>
      <title><![CDATA[IBM developerWorks: Create REST applications with the Slim micro-framework]]></title>
      <guid>http://www.phpdeveloper.org/news/18903</guid>
      <link>http://www.phpdeveloper.org/news/18903</link>
      <description><![CDATA[<p>
On the IBM developerWorks site there's a new tutorial posted walking you through the process of creating a <a href="http://www.ibm.com/developerworks/xml/library/x-slim-rest/index.html">REST application with Slim</a>, a popular microframework for PHP.
</p>
<blockquote>
In this article, I introduce you to Slim, a PHP micro-framework that's designed for rapid development of web applications and APIs. Don't be fooled by the name: Slim comes with a sophisticated URL router and support for page templates, flash messages, encrypted cookies, and middleware. It's also extremely easy to understand and use, and it comes with great documentation and an enthusiastic developer community.
</blockquote>
<p>
They start off by defining REST in terms of its usual four "verbs" - GET, POST, PUT and DELETE - and the conventions of the types of actions for each. Once you get the framework installed (via <a href="http://getcomposer.org">Composer</a>) they help you create a sample database with an "articles" table and some sample data your service will work with. They go through each of the "verbs" and include code showing how to respond to the requests for each, including some exceptions for when things go wrong. There's also a bit about adding authentication "middleware" to the process - a hook to validate a user key as a part of the routing process. They finish things off by showing how to support multiple response formats and like XML and JSON based on the requested media type.
</p>]]></description>
      <pubDate>Mon, 17 Dec 2012 12:56:24 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Writing a RESTful Web Service with Slim]]></title>
      <guid>http://www.phpdeveloper.org/news/18283</guid>
      <link>http://www.phpdeveloper.org/news/18283</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial showing you how to <a href="http://phpmaster.com/writing-a-restful-web-service-with-slim/">create a simple RESTful API</a> with the help of the <a href="http://www.slimframework.com/">Slim</a> PHP microframework.
</p>
<blockquote>
<a href="http://phpmaster.com/rest-can-you-do-more-than-spell-it-1/">Through a series of articles</a> here at PHPMaster you've learned about what is REST and how it works. In this article, I'd like to show you how to create a RESTful web service using Slim, a PHP micro-framework inspired by Sinatra, a Ruby framework. It's well-suited for creating simple RESTful web services and comes with some minimal components like Router, Request, Response, and View. It's very simple, and is easy to understand and use.
</blockquote>
<p>
He walks you through the basics of getting the framework downloaded and set up as well as showing you how to make some basic routes ("Hello World" style). He then uses the <a href="http://www.notorm.com/">NotORM</a> library to work with his database and, via a RESTful interface, give information about books, edit their information and add new ones.
</p>]]></description>
      <pubDate>Fri, 27 Jul 2012 10:53:30 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Creating a Flat-File Blog Engine Using Slim]]></title>
      <guid>http://www.phpdeveloper.org/news/18110</guid>
      <link>http://www.phpdeveloper.org/news/18110</link>
      <description><![CDATA[<p>
On the NetTus.com site today there's a new tutorial showing how to use the Slim microframework to <a href="http://net.tutsplus.com/tutorials/php/creating-a-flat-file-blog-engine-using-slim/">create a flat-file blog system</a> as a stand alone PHP application.
</p>
<blockquote>
In this article, we will learn how to create a flat file blog engine in PHP using the Slim framework. If you don't understand the jargon, don't worry. We're simply going to create a spartan blogging application, which utilizes text files instead of a database to store data. If you're a beginner, fret not! We will start with the basics of using <a href="http://www.slimframework.com/">Slim</a>.
</blockquote>
<p>
He introduces the Slim framework with a simple route handling to render a basic PHP page (an "About" page), setting variables to output to the template, setting up dynamic routes and creating the setup for the blogging engine (viewing articles, archives and a listing page).
</p>]]></description>
      <pubDate>Tue, 19 Jun 2012 08:48:15 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: Simple API Testing Using Behat]]></title>
      <guid>http://www.phpdeveloper.org/news/17589</guid>
      <link>http://www.phpdeveloper.org/news/17589</link>
      <description><![CDATA[<p>
<i>Chris Hartjes</i> has taken some of his first steps to testing a web service with the help of the <a href="http://behat.org">Behat</a> BDD testing framework. In <a href="http://www.littlehart.net/atthekeyboard/2012/02/26/simple-api-testing-with-behat/">this new post</a> he shares some of that knowledge and a bit of code to help guide you if you'd like to get started yourself.
</p>
<blockquote>
I have been trying to push my JavaScript skills lately by first playing around with Node.js to get a feel for event-driven server-side coding and by trying to build something semi-useful using <a href="http://knockoutjs.com/">Knockout</a>. [...] After working with PHPUnit's "assert that the result matches expectations" philosophy, switching to using a behavioural approach has changed how I decide to approach actually testing something. 
</blockquote>
<p>
He shows how to define a "scenario" in a more recognizable sort of English. His example is testing a web service to ensure of a few things:
</p>
<ul>
<li>the response is JSON
<li>it contains at least one transaction
<li>the first transaction has an ID, contains two teams and has a description
</ul>
<p>
Included in the post is the resulting Behat test code (generated and modified with his testing details) and an example of the execution of the test.
</p>
<blockquote>
I think that the BDD approach maps better to a results-oriented methodology when it comes to testing: you are using real-life scenarios to make sure that you are getting back the results you are expecting. In the end. that is still the goal of testing.
</blockquote>]]></description>
      <pubDate>Mon, 27 Feb 2012 10:09:18 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: Organzing Slim Framework Applications]]></title>
      <guid>http://www.phpdeveloper.org/news/17542</guid>
      <link>http://www.phpdeveloper.org/news/17542</link>
      <description><![CDATA[<p>
One of the more popular PHP microframeworks right now is <a href="http://www.slimframework.com/">Slim</a> and <i>Chris Hartjes</i> has <a href="http://www.littlehart.net/atthekeyboard/2012/02/14/organizing-slim-framework-apps/">a new post to his blog</a> about a good way he's found for organizing applications that use this handy tool.
</p>
<blockquote>
I've never really used a microframework in PHP before. I used <a href="http://flask.pocoo.org/">Flask</a> for a Python <a href="https://github.com/chartjes/liesitoldmykids">project</a> that I did to experiment with using Google App Engine. The principles seem to be quite similar (although I will admit that having decorators in PHP would be ineresting) but the trade-off with a microframework is that you usually have to figure out an application layout for yourself.
</blockquote>
<p>
He also uses the <a href="http://pimple.sensiolabs.org/">Pimple</a> dependency injection container, <a href="http://twig.sensiolabs.org/">Twig</a> templating and <a href="http://packagist.org/about-composer">Composer</a> for package management. He describes how he got it all set up - organizing the code so Composer could understand it, creating the Twig templates directory and creating some of his default routes.
</p>]]></description>
      <pubDate>Wed, 15 Feb 2012 08:57:28 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[ZendCasts.com: Building a JSON End-Point With SLIM and jQuery: Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/17106</guid>
      <link>http://www.phpdeveloper.org/news/17106</link>
      <description><![CDATA[<p>
On ZendCasts.com today there's a new screencast in their "Building a JSON endpoint with the Slim microframework" series - <a href="http://www.zendcasts.com/building-a-json-end-point-with-slim-and-jquery-part-2/2011/11/">part two</a> focusing on jQuery integration. (Part one <a href="http://phpdeveloper.org/news/17044">is here</a>)
</p>
<blockquote>
[This screencast is] part 2 in a series on building a JSON end-point. We're using simple RESTful verbage to grab a list of names from a session store.
</blockquote>
<p>
You'll need to have the base scripts created in <a href="http://phpdeveloper.org/news/17044">part one</a> to follow along effectively. He picks up right where the previous part ends, creating a new view that uses some simple javascript (jQuery) code to pull the "names" values from his simple JSON endpoint. Also included is an example of a form for adding a new name to the list. The full source for the example can be <a href="https://gist.github.com/1346313">found over on github</a>.
</p>]]></description>
      <pubDate>Wed, 09 Nov 2011 10:04:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[ZendCasts.com: Building a JSON Endpoint with SLIM (Part 1)]]></title>
      <guid>http://www.phpdeveloper.org/news/17044</guid>
      <link>http://www.phpdeveloper.org/news/17044</link>
      <description><![CDATA[<p>
On ZendCasts.com today, the next part of their series looking at using the <a href="http://slimframework.com">Slim microframework</a> has been posted. This is <a href="http://www.zendcasts.com/building-a-json-endpoint-with-slim-part-1/2011/10/">part one</a> of a tutorial building a JSON endpoint for a web service.
</p>
<p>
You'll need some of the base that he created in <a href="http://www.zendcasts.com/slimming-out-your-controller/2011/10/">this previous screencast</a> to follow along (the basic structure, really). His takes his basic "hello world" application and builds on it to add a "model" to pull name data from and has the "/names" action respond with a JSON-formatted message (and an "application/json" content-type). His "model" pulls the data out with findAll() and find() methods.
</p>
<p>
You can <a href="https://gist.github.com/1314258">grab the source</a> to follow along.
</p>]]></description>
      <pubDate>Wed, 26 Oct 2011 10:51:45 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ZendCasts.com: SLIMming Out Your Controller]]></title>
      <guid>http://www.phpdeveloper.org/news/17007</guid>
      <link>http://www.phpdeveloper.org/news/17007</link>
      <description><![CDATA[<p>
On the ZendCasts.com site today, they branch out from just talking about Zend Framework-related topics and take a look at he <a href="http://www.slimframework.com/">Slim micro-framework</a> in <a href="http://www.zendcasts.com/slimming-out-your-controller/2011/10/">this new screencast</a>.
</p>
<p>
He introduces the framework as a light-weight, easy to use tool that doesn't include "all of that extra stuff". He walks you through the creation of a (very) simple site that includes some basic templating too. At the end of the screencast he hints at the next part of the series - creating a simple JSON endpoint as a RESTful web service.
</p>
<p>
You can find out more about the Slim framework <a href="http://www.slimframework.com/">on its site</a> that includes documentation and a <a href="http://dev.slimframework.com/phpdocs/">PHPDoc generated manual</a> for every part of the code.
</p>]]></description>
      <pubDate>Tue, 18 Oct 2011 11:02:58 -0500</pubDate>
    </item>
  </channel>
</rss>
