<?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 05:26:24 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Rob Allen's Blog: Hooks in Action Helpers]]></title>
      <guid>http://www.phpdeveloper.org/news/11348</guid>
      <link>http://www.phpdeveloper.org/news/11348</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has <a href="http://akrabat.com/2008/11/05/hooks-in-action-helpers/">posted this look</a> at using hooks inside of action helpers (a follow-up from his <a href="http://akrabat.com/2008/10/31/using-action-helpers-in-zend-framework/">previous article</a> on action helpers):
</p>
<blockquote>
Hooks are a feature of action helpers that allow you to automatically run code at certain points in the dispatch cycle. Specially, there are two hook functions available for action helpers: preDispatch and postDispatch. These allow you to ensure that some functionality is always run for each request.
</blockquote>
<p>
He creates a simple action helper that grabs a random quote from an array and drops it into a property of the helper. By defining a preDispatch method inside of the helper, the HelperBroker knows to pull the method in an execute it immediate before the rest of the actions are executed. A calls to addHelper with the hooks defined is all it takes to glue it together with the execution.
</p>]]></description>
      <pubDate>Wed, 05 Nov 2008 09:34:40 -0600</pubDate>
    </item>
  </channel>
</rss>
