<?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>Sat, 25 May 2013 11:45:47 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: An Introduction to the Front Controller Pattern, Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/18327</guid>
      <link>http://www.phpdeveloper.org/news/18327</link>
      <description><![CDATA[<p>
PHPMaster.com has posted the <a href="http://phpmaster.com/front-controller-pattern-2/">second part</a> of their series introducing you to one of the more popular design patterns in PHP frameworks right now - the Front Controller pattern. <a href="http://phpmaster.com/front-controller-pattern-1">Part 1</a> introduced some of the fundamental concepts and this new article expands on that, getting more into the request and reponse handling process.
</p>
<blockquote>
One of the best things about front controllers is that you can keep them running as tight structures, just routing and dispatching incoming requests, or you can let your wild side show and implement a full-fledged RESTful controller capable of parsing HTTP verbs, accommodating pre/post dispatch hooks, and the like, all behind a unified API. [I'd like to show] you how easy is to deploy a small, yet extensible, HTTP framework capable of putting to work a front controller along with the ones of a standalone router and a dispatcher. Plus, the whole request/response cycle will be independently handled by a couple of reusable classes, which naturally you'll be able to tweak at will.
</blockquote>
<p>
He bases his examples off of the <a href="https://github.com/lstrojny/EPHPMVC/tree/master/library">EPHPMVC</a> project, showing how to implement a RequestInterface, ResponseInterface and link them together with a RouteInterface and use the DispatcherInterface to handle the requests. The front controller is then created with its run() method and an instance is created in a main PHP file that all requests are routed through.
</p>]]></description>
      <pubDate>Tue, 07 Aug 2012 11:06:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney: ZF2's New Controller::init()]]></title>
      <guid>http://www.phpdeveloper.org/news/18293</guid>
      <link>http://www.phpdeveloper.org/news/18293</link>
      <description><![CDATA[<p>
In his latest post <i>Matthew Weier O'Phinney</i> introduces you to <a href="http://mwop.net/blog/2012-07-30-the-new-init.html">the new init() method</a> in the Zend Framework 2 controllers and how it differs from the one in version 1.
</p>
<blockquote>
In Zend Framework 1, controller's had an init() method, which was called after the controller was instantiated. The reason for it was to encourage developers not to override the constructor, and thus potentially break some of the functionality (as a number of objects were injected via the constructor). init() was useful for doing additional object initialization. [...] But this feature is missing from ZF2; how can we accomplish this sort of pattern?
</blockquote>
<p>
In Zend Framework 2, there's no Controller constructor by default anymore, so you have to do things slightly differently. He shows you how to use the event manager to simulate the same thing, attaching an event to the "dispatch" of the controller to do the work. He came back and updated the post with a second method that could do the same thing - using the ServiceManager from inside a module and attaching the event that way.
</p>]]></description>
      <pubDate>Tue, 31 Jul 2012 08:44:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Module specific bootstrapping in ZF2]]></title>
      <guid>http://www.phpdeveloper.org/news/17646</guid>
      <link>http://www.phpdeveloper.org/news/17646</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has a new post to his blog today looking at <a href="http://akrabat.com/zend-framework-2/module-specific-bootstrapping-in-zf2/">bootstrapping specific modules</a> in a Zend Framework 2-based application without having to do the entire set.
</p>
<blockquote>
Following on from the <a href="http://akrabat.com/zend-framework-2/modules-in-zf2/">discussion on modules</a>, we can hook into the event system to do module specific bootstrapping. By this, I mean, if you have some code that you want to run only if the action to be called is within this module, you can hook into the Application's dispatch event to achieve this.
</blockquote>
<p>
He starts with an example of a basic module (Simple/Module.php) and shows how to define an "onBootstrap" method that calls the "onDispatch" method (when hooked to the event manager) to do some module-specific bootstrap operations. The RouteMatch feature is used to ensure that you're in the right controller/namespace combo to use the module.
</p>]]></description>
      <pubDate>Thu, 08 Mar 2012 10:04:20 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Simple Interfaces and Micro MVCs]]></title>
      <guid>http://www.phpdeveloper.org/news/15624</guid>
      <link>http://www.phpdeveloper.org/news/15624</link>
      <description><![CDATA[<p>
In <a href="http://weierophinney.net/matthew/archives/250-Simple-Interfaces-and-Micro-MVCs.html">a new post</a> to his blog today <i>Matthew Weier O'Phinney</i> takes a look at micro MVC frameworks and how, with just a bit of lightweight code and pieces of the Zend Framework, creating one is dead simple.
</p>
<blockquote>
My job is great: I get to play with technology and code most days. My job is also hard: how does one balance both functionality and usability in programming interfaces? [...] One interface I've been toying with is inspired by two very different sources. The first is PHP's own <a href="http://php.net/SoapServer">SoapServer API</a> (which we use already in our various server components); the other was a discussion I had with <a href="http://fabien.potencier.org/">Fabien Potencier</a> (of Symfony fame) a couple years ago, where he said the goal of Symfony 2 would be "to transform a request into a response." 
</blockquote>
<p>
The result is a simple Dispatachable interface that acts as the lowest level to build the whole MVC on top of. He illustrates with a micro MVC example that uses the Dispatchable interface to create a Dispatcher class to handle the incoming requests and attach various endpoints for handling. An example of it in use is also included.
</p>]]></description>
      <pubDate>Thu, 23 Dec 2010 09:29:07 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Zend Framework Dispatch Workflow Diagram]]></title>
      <guid>http://www.phpdeveloper.org/news/12503</guid>
      <link>http://www.phpdeveloper.org/news/12503</link>
      <description><![CDATA[<p>
In <a href="http://devzone.zend.com/article/4601-Zend-Framework-Dispatch-Workflow-Diagram">this new post</a> to the Zend Developer Zone, they point out a workflow diagram <i>Polley Wong</i> has come up with showing how the Zend Framework's dispatch system works (request handling).
</p>
<blockquote>
I've been researching Zend Framework lately and was curious about what's actually happening behind the scene of the whole dispatch process. Inspired by Thorsten Ruf's (<a href="http://nethands.de/download/zenddispatch_en.pdf">zenddispatch_en.pdf</a>) clear and beautifully presented workflow, I decided to go a step deeper and crawl Zend Framework's code. I came up with my own version of the flexible yet complicated workflow.
</blockquote>
<p>
You can check out this new PDF <a href="http://s3.amazonaws.com/ppt-download/zendframeworkdispatchworkflow-090508180623-phpapp02.pdf">here</a>. It diagrams out an overall view of the request handling, a look at what happens inside the front controller including components like the Controller Dispatcher, Action Controller, Action Helper Broker and Response Object.
</p>]]></description>
      <pubDate>Wed, 13 May 2009 08:47:33 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jani Hartikainen's Blog: Improving Ajax performance in Zend Framework applications]]></title>
      <guid>http://www.phpdeveloper.org/news/12184</guid>
      <link>http://www.phpdeveloper.org/news/12184</link>
      <description><![CDATA[<p>
New on his blog <i>Jani Hartikainen</i> has <a href="http://codeutopia.net/blog/2009/03/23/improving-ajax-performance-in-zend-framework-applications/">posted a simple idea</a> that you can take to make sure you're getting the most out of your Ajax/Zend Framework connections.
</p>
<blockquote>
A common reason to use Ajax in a website is to make it feel faster, so you usually want Ajax requests be processed as quickly as possible. While there are <a href="http://framework.zend.com/manual/en/performance.html">many ways to speed up Zend Framework</a> based applications, there are still some things like routing and dispatching which still add up to the total. There is, however, another way to make Ajax work even faster
</blockquote>
<p>
Since Ajax requests don't usually require all of the complex routing and dispatching that a normal Zend Framework request might, he recommends creating a separate Ajax handler. His includes an example of a simple searching endpoint with a class handling the backend logic. A simple handler script loads up the bootstrap and makes the request for the search, returning the search results in a JSON format.
</p>]]></description>
      <pubDate>Mon, 23 Mar 2009 08:45:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Front Controller Plugins in Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/9971</guid>
      <link>http://www.phpdeveloper.org/news/9971</link>
      <description><![CDATA[<p>
On the Zend Developer Zone, there's a <a href="http://devzone.zend.com/article/3372-Front-Controller-Plugins-in-Zend-Framework">new article</a> that examines one of the key components to just about any framework out there - the front controller.
</p>
<blockquote>
Like <a href="http://devzone.zend.com/article/3350-Action-Helpers-in-Zend-Framework">Action Helpers</a>, which I've discussed in a previous article, Front Controller Plugins in <a href="http://framework.zend.com/">Zend Framework</a> are often considered an esoteric, advanced subject. They are, however, remarkably simple to implement, and provide an easy way to extend the functionality and behavior of your entire web application.
</blockquote>
<p>
The article (from <i>Matthew Weir O'Phinney</i>) looks at the hooks defined in the controller, like routeStartup and preDispatch, and how to work with the controller to add in/get plugins from it. He provides a two  examples too: Application Initialization Plugin and a Caching Plugin.
</p>]]></description>
      <pubDate>Tue, 15 Apr 2008 07:58:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: The state of functional programming in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/9253</guid>
      <link>http://www.phpdeveloper.org/news/9253</link>
      <description><![CDATA[<p>
On the SitePoint PHP Blog today, <i>Troels Knak-Nielsen</i> has <a href="http://www.sitepoint.com/blogs/2007/12/15/the-state-of-functional-programming-in-php/">written up a post</a> concerning the current state of <a href="http://lambda-the-ultimate.org/node/2539">functional programming</a> in PHP.
</p>
<blockquote>
With the rise of Javascript, and languages like Python and Ruby, <a href="http://lambda-the-ultimate.org/node/2539">functional programming</a> is becoming more mainstream. Even Java seems to be <a href="http://rickyclarkson.blogspot.com/2007/11/java-7-example-writing-your-own-foreach.html">getting closures</a> in the next version, so does this leave PHP lacking behind or is there an unrealized potential hidden within?
</blockquote>
<p>
He looks at a few different aspects of functional programming and sees how well PHP fits into them (like dynamic dispatch, binding a variable to a function and an implementation of <a href="http://en.wikipedia.org/wiki/Currying">currying</a> for a function). This last option is the only "true" functional feature that PHP can realistically handle. 
</p>]]></description>
      <pubDate>Mon, 17 Dec 2007 10:28:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[phpaddiction: Url Routing with PHP - Part Three]]></title>
      <guid>http://www.phpdeveloper.org/news/7625</guid>
      <link>http://www.phpdeveloper.org/news/7625</link>
      <description><![CDATA[<p>
phpaddiction has posted <a href="http://www.phpaddiction.com/tags/php/url-routing-with-php-part-three/">part three</a> of its URL Rewriting tutorial series today - the creation of the "C" (Controller) in MVC.
</p>
<blockquote>
In the final part of this series, I will build a functional modular front controller that can be easily adapted to small projects. It is basically the "C" in MVC for a simple MVC framework. If you haven't read the first two articles I recommend that you read over them first. <a href="http://www.phpaddiction.com/tags/axial/url-routing-with-php-part-one/">Url Routing with PHP - Part One</a> and <a href="http://www.phpaddiction.com/tags/php/url-routing-with-php-part-two/">Url Routing with PHP - Part Two</a>.
</blockquote>
<p>
They start with the base created before (with some slight modifications) and build up the dispatcher to handle their new requests and the controller to respond. In their example, when the Controller is called, it runs the execute() method and, based on the input, either calls another function or returns an error if it doesn't exist.
</p>]]></description>
      <pubDate>Mon, 16 Apr 2007 07:03:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[phpaddiction: Url Routing with PHP - Part Two]]></title>
      <guid>http://www.phpdeveloper.org/news/7574</guid>
      <link>http://www.phpdeveloper.org/news/7574</link>
      <description><![CDATA[<p>
On the phpaddiction site today, there's <a href="http://www.phpaddiction.com/tags/php/url-routing-with-php-part-two/">part two</a> of their tutorial looking at URL routing with PHP (started <A href="http://www.phpdeveloper.org/news/7532">here</a> in Part One).
</p>
<p>
With the foundation of the routing in place (from part one), they move on to bigger and better things:
<ul>
<li>assign responsibilities (what needs to be accomplished)
<li>creating a standard command object
<li>interpreting the URLs and the parameters passed in it
<li>using this information to dispatch the correct commands
</ul>
There's code examples through out to illustrate each point as well as one main one at the end to show how to put it all into action. Their script reads in the URL and sends the command along to the CommandDispatcher - check out <a href="http://examples.phpaddiction.com/urlrouter/part_2/">this example page</a> to see it in action.
</p>]]></description>
      <pubDate>Fri, 06 Apr 2007 08:41:00 -0500</pubDate>
    </item>
  </channel>
</rss>
