<?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, 18 Jun 2013 17:27:18 -0500</pubDate>
    <ttl>30</ttl>
    <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[Cal Evans' Blog: Quickie Zend Framework Bootstrap Note]]></title>
      <guid>http://www.phpdeveloper.org/news/13040</guid>
      <link>http://www.phpdeveloper.org/news/13040</link>
      <description><![CDATA[<p>
<i>Cal Evans</i> has posted <a href="http://blog.calevans.com/2009/08/13/quickie-zend-framework-bootstrap-note/">a Zend Framework quickie</a> for working with the bootstrap in your application.
</p>
<blockquote>
I've been teaching a <a href="http://framework.zend.com/">Zend Framework</a> class this week and my students have been throwing all kinds of questions at me. Most recently, while we were discussing creating a Bootstrap class for an application a question came up about the _init* functions.
</blockquote>
<p>
The documentation talks about the bootstrap loading those init functions, but it leaves out the order they're executed in. <i>Cal</i> did a bit of research and found that they're executed in the order they're created with one exception - if you specify one to run first in the bootstrap constructor.
</p>]]></description>
      <pubDate>Thu, 13 Aug 2009 13:25:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Daniel Cousineau's Blog: Zend Framework Module Init Script (Controller Plugin)]]></title>
      <guid>http://www.phpdeveloper.org/news/11689</guid>
      <link>http://www.phpdeveloper.org/news/11689</link>
      <description><![CDATA[<p>
<i>Daniel Cousineau</i> has <a href="http://www.toosweettobesour.com/2009/01/06/zend-framework-module-init-script-controller-plugin/">a new blog post</a> showing off a plugin he's made for Zend Framework applications that allows you to run a script before each controller.
</p>
<blockquote>
Recently at work I had the need to run a script before every single controller (namely to add a plugin folder to Dwoo) for a specific module that I did not desire for any other modules. I could have subclassed all my controllers to extend a custom action controller that handled this in the init() method, however I'm lazy so I wrote a quick Zend Controller Plugin to handle this for me.
</blockquote>
<p>
The plugin actually runs when the routeShutdown method is used (after the routing is done, but before the controller is called) and pulls in the contents of the specified file and executes it like the code was already embedded. Complete code is included.
</p>]]></description>
      <pubDate>Wed, 07 Jan 2009 09:35:41 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ben Ramsey's Blog: Zend Framework View Notes]]></title>
      <guid>http://www.phpdeveloper.org/news/7565</guid>
      <link>http://www.phpdeveloper.org/news/7565</link>
      <description><![CDATA[<p>
In a <a href="http://benramsey.com/archives/zend-framework-view-notes/">new entry</a> today, <i>Ben Ramsey</i>, how's been working with the Zend Framework for a bit now, shares an interesting bit of information about how to use Views a little bit differently.
</p>
<blockquote>
Most notably, I've started using the "new way" of using views, which is still undocumented in the manual. Rather than create a new Zend_View object, tell it where my views are, and echo a call to its render() method, I'm letting the controller's render() method do it all for me.
</blockquote>
<p>
He illustrates with a <a href="http://benramsey.com/archives/zend-framework-view-notes/">simple example</a> using the default framework directory setup, save for the special "scripts" directory he creates. This makes it possible for the controller to handle the rendering rather than the typical view functionality. Then, using the views is a simple init() call away, automagically.
</p>]]></description>
      <pubDate>Thu, 05 Apr 2007 06:59:44 -0500</pubDate>
    </item>
  </channel>
</rss>
