<?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, 12 Feb 2012 21:19:31 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Rob Allen's Blog: Handling exceptions in a Front Controller plugin]]></title>
      <guid>http://www.phpdeveloper.org/news/15602</guid>
      <link>http://www.phpdeveloper.org/news/15602</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has another Zend Framework-themed post to his blog today looking at <a href="http://akrabat.com/zend-framework/handling-exceptions-in-a-front-controller-plugin/">handling exceptions in front controllers</a> a bit more correctly than they're currently treated.
</p>
<blockquote>
If you have a Zend Framework Front Controller plugin which throws an exception, then the action is still executed and then the error action is then called, so that the displayed output shows two actions rendered, with two layouts also rendered. This is almost certainly not what you want or what you expected.
</blockquote>
<p>
He points out the more correct process it should follow - dispatch the request and catch the error there before the request continues. The error is then tossed to the error controller for correct handling. He includes the code to do just that, showing how to wrap the routing in a try/catch and push the exception over to the error controller with an "error_handler" plugin created with an exception type of "other".
</p>]]></description>
      <pubDate>Mon, 20 Dec 2010 11:52:48 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Bradley Holt's Blog: Front Controller Pattern in Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/13945</guid>
      <link>http://www.phpdeveloper.org/news/13945</link>
      <description><![CDATA[<p>
As a part of his demo (presented at a local user group meeting) <i>Bradley Holt</i>, not having enough time to squeeze in all of the content he wanted, has started off a series of posts to his blog <a href="http://bradley-holt.blogspot.com/2010/01/front-controller-pattern-in-zend.html">about the Zend Framework</a> and the specific areas that make it up. His first article is about the front controller.
</p>
<blockquote>
Like many other frameworks, Zend Framework provides an implementation of the <a href="http://en.wikipedia.org/wiki/Front_Controller_pattern">Front Controller pattern</a>. This means that all HTTP requests can be sent through a centralized point. This allows you to take advantage of Zend Framework's routing and Model-View-Controller (MVC) components, if you so choose. 
</blockquote>
<p>
He talks about where the Zend Framework places this controller and what their version of it contains - constant definitions, loading paths and the creation of a Zend_Application instance that's called to do the real work. He also includes a few helpful tips on common problems you might come across when setting up your application.
</p>]]></description>
      <pubDate>Mon, 01 Feb 2010 12:56:13 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP in Action: The one-line web framework]]></title>
      <guid>http://www.phpdeveloper.org/news/11582</guid>
      <link>http://www.phpdeveloper.org/news/11582</link>
      <description><![CDATA[<p>
On the PHP in Action blog <a href="http://www.reiersol.com/blog/1_php_in_action/archive/172_the_one-line_web_framework.html">this new post</a> talks about something that's at the core of the front controller for most frameworks - a call to a user function based on the passed in action.
</p>
<blockquote>
The core of your average web framework is a Front Controller. Front Controllers are commonly considered complex and esoteric. That's a myth. I sometimes brag that I can construct a Front Controller in 15 minutes. Actually, it's doesn't take quite that long. In PHP, a Front Controller can be simplified to just one line of code.
</blockquote>
<p>
This one line of code, while a very dangerous thing to actually use in an application, illustrates what a front controller does to forward out the request to the rest of the framework. He revises it with a Zend Framework-ish example that splits the request out into a controller/action method.
</p>]]></description>
      <pubDate>Tue, 16 Dec 2008 12:09:42 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[phpaddiction: Url Routing with PHP - Part One]]></title>
      <guid>http://www.phpdeveloper.org/news/7532</guid>
      <link>http://www.phpdeveloper.org/news/7532</link>
      <description><![CDATA[<p>
The phpaddiction website has posted <a href="http://www.phpaddiction.com/tags/axial/url-routing-with-php-part-one/">the first part of a series</a> today covering URL routing with PHP (commonly used by frameworks to route requests through a centralized location.
</p>
<blockquote>
Most PHP frameworks use some variation of the front controller pattern to centralize common code and logic. There are advantages and disadvantages to this. I am going to ignore those for now. In fact the first part of this series will explore a simple procedural URL routing method that contains many of the disadvantages. In later articles we will build upon this basis and address the disadvantages.
</blockquote>
<p>
He walks through <a href="http://www.phpaddiction.com/tags/axial/url-routing-with-php-part-one/">the steps</a> to get things set up - working with mod_rewrite, creating the "entry point" for your application, and finally, how to execute a command based on the request's action.
</p>]]></description>
      <pubDate>Fri, 30 Mar 2007 08:12:00 -0500</pubDate>
    </item>
  </channel>
</rss>

