<?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>Tue, 21 May 2013 19:17:30 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Dave Marshall: Silex Controllers as Services]]></title>
      <guid>http://www.phpdeveloper.org/news/18549</guid>
      <link>http://www.phpdeveloper.org/news/18549</link>
      <description><![CDATA[<p>
<i>Dave Marshall</i> has written up a post about how he <a href="http://davedevelopment.co.uk/2012/10/03/Silex-Controllers-As-Services.html">uses Silex controllers as services</a> that allow him to define his controller methods in separate classes with a custom resolver.
</p>
<blockquote>
There's currently a pull request in the queue for <a href="http://silex.sensiolabs.org/">Silex</a> that adds a cookbook entry for using controller classes, but I wanted to take it a step further and have my controllers as services, much like <a href="http://symfony.com/doc/current/cookbook/controller/service.html">what's possible</a> with the full symfony framework (See <a href="http://richardmiller.co.uk/2011/04/15/symfony2-controller-as-service/">Richard Miller's post</a> for further reading).
</blockquote>
<p>
He includes some example code showing the creation of the Silex application with a service definition, the custom "ControllerResolver" to override the default and a simple controller class ("PostController") that just returns a JSON response. You can find the full example code for it <a href="https://github.com/davedevelopment/silex-service-controllers">on github</a>.
</p>]]></description>
      <pubDate>Wed, 03 Oct 2012 09:36:15 -0500</pubDate>
    </item>
  </channel>
</rss>
