<?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>Fri, 24 May 2013 17:31:29 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: A little more advanced ZF2 EventManager usage]]></title>
      <guid>http://www.phpdeveloper.org/news/17856</guid>
      <link>http://www.phpdeveloper.org/news/17856</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has a new post to his his blog with a <a href="http://www.eschrade.com/page/a-little-more-advanced-zf2-eventmanager-usage/">bit more advanced example</a> of using the Zend Framework 2 EventManager to make global event triggers.
</p>
<blockquote>
If you look at my previous post on the <a href="http://www.eschrade.com/page/zend-framework-2-event-manager/">ZF2 EventManager</a> class you might be tempted to think that you are limited only to listening to events for local instances of the event manager.  But no, my friend, you would be wrong. The event manager actually provides access to a sort of global event manager.  But it's more than that.  This global event manager allows you to listen in on events for various targets.
</blockquote>
<p>
He includes an example of how to use the EventManager in a specific namespace that's triggered based on a custom event. He attaches a custom class, "cls2", to a listener on his "ns1/cls1" class.
</p>]]></description>
      <pubDate>Tue, 24 Apr 2012 08:54:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: An introduction to ZendEventManager]]></title>
      <guid>http://www.phpdeveloper.org/news/17849</guid>
      <link>http://www.phpdeveloper.org/news/17849</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has a new post to his blog today <a href="http://akrabat.com/zend-framework-2/an-introduction-to-zendeventmanager/">introducing you to the ZendEventManager</a> component of the Zend Framework v2, a key part of how this latest version of the framework does its job.
</p>
<blockquote>
Zend Framework 2's EventManager is a key component of the framework which is used for the core MVC system. The EventManager allows a class to publish events that other objects can listen for and then act when the event occurs. The convention within Zend Framework 2 is that any class that triggers events composing its own EventManager.
</blockquote>
<p>
He starts with some terminology to get everyone on the same page (listener, event, EventManager) and includes an example of its use in setting up a "PhotoMapper" object showing how to trigger events in the "findById" method. He shows how to listen for a specific event (in his case, a "pre-execute" on the "findById" method) and a method for "short circuiting" the listener based on the response from the "trigger" call. He also touches on the "SharedEventManager" that can be used to add an event across all of your application at the same time.
</p>]]></description>
      <pubDate>Mon, 23 Apr 2012 09:29:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: A list of ZF2 Events]]></title>
      <guid>http://www.phpdeveloper.org/news/17683</guid>
      <link>http://www.phpdeveloper.org/news/17683</link>
      <description><![CDATA[<p>
In a reference sort of post, <i>Rob Allen</i> has <a href="http://akrabat.com/zend-framework-2/a-list-of-zf2-events/">listed out the events</a> that are provided in the Zend Framework 2 "Application" functionality.
</p>
<blockquote>
Both the Module Manager and the MVC system use the Event Manger extensively in order to provide "hook points" for you to add your own code into the application flow. This is a list of the events triggered by each class during a standard request with the Skeleton Application.
</blockquote>
<p>
It's broken up into the three main chunks - Module Manager, Bootstrap and Application - with any sub-requests and their sources (like "render", "dispatch" or "response"). You can find out more about ZF2's Event Manager in other posts like <a href="http://www.eschrade.com/page/zend-framework-2-event-manager/">this one from Kevin Schroeder</a> or <a href="http://mwop.net/blog/266-Using-the-ZF2-EventManager">this</a> from <i>Matthew Weier O'Phinney</i>.
</p>]]></description>
      <pubDate>Fri, 16 Mar 2012 09:49:15 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Robert Basic's Blog: A Zend Framework 2 EventManager use case]]></title>
      <guid>http://www.phpdeveloper.org/news/17021</guid>
      <link>http://www.phpdeveloper.org/news/17021</link>
      <description><![CDATA[<p>
<i>Robert Basic</i> has a new post to his blog today with an <a href="http://robertbasic.com/blog/azend-framework-2-eventmanager-use-case/">use case for Zend Framework 2's event manager</a> to solve a problem he has with "repetitive code" in some of his models.
</p>
<blockquote>
Basically, this allows us to have one piece of code to trigger an event and to have one or more listeners listening to this event. When the event gets triggered, the listeners are called and then we can do *something*, like caching or logging. Logging or caching. [...] See, that's my problem. All the event examples stop at logging and caching. Truly there must be some other example for which this event stuff can be used for.
</blockquote>
<p>
In his example code, he's used the EventManager in one of his models to add listeners to validate the post and "slugify" the post's title for use on the URL. You can <a href="https://github.com/robertbasic/blog-examples/blob/master/zf2-event-manager/index.php">find his code on github</a> if you're interested in the full implementation.
</p>]]></description>
      <pubDate>Thu, 20 Oct 2011 11:05:43 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: Zend Framework 2 Event Manager]]></title>
      <guid>http://www.phpdeveloper.org/news/16869</guid>
      <link>http://www.phpdeveloper.org/news/16869</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has a new post today sharing some of his <a href="http://www.eschrade.com/page/zend-framework-2-event-manager">experience with the Zend Framework 2 Event Manager</a> in a simple example of pre- and post-validation hooks in a model.
</p>
<blockquote>
I got to play with the Event Manager.  I did like the plugin functionality in ZF1, but it required some pretty static coding.  In some cases, like the front controller plugins, it makes more sense (though this way seems more desirable). [...] It's a ZF1 application, but since (it seems) the event manager is self-contained (and the autoloader works with both ZF1 and ZF2) you can simply paste it into your include_path and BOOM, you have an event manager.
</blockquote>
<p>
In his case he has a set of models extending a base class and wanted to introduce pre- and post-validation hooks to make it simpler to check the data he was working with. He includes the code for his base model class showing how he implemented the ZF2 EventManager in his ZF1 application. He attaches an event to the password class property and, on update, it automatically updates a temporary password value too.
</p>
<p>
You can get more information on using the EventManager in <a href="http://phpdeveloper.org/news/16850">this other post</a> from <i>Matthew Weier O'Phinney</a>.
</p>]]></description>
      <pubDate>Fri, 16 Sep 2011 11:40:47 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Using the ZF2 EventManager]]></title>
      <guid>http://www.phpdeveloper.org/news/16850</guid>
      <link>http://www.phpdeveloper.org/news/16850</link>
      <description><![CDATA[<p>
<i>Matthew Weier O'Phinney</i>, lead on the <a href="http://framework.zend.com">Zend Framework</a> project, has a new post to his blog talking about the <a href="http://weierophinney.net/matthew/archives/266-Using-the-ZF2-EventManager.html">event manager in the Zend Framework, v2</a> and how to use it in a refectored version of a <a href="http://weierophinney.net/matthew/archives/251-Aspects,-Filters,-and-Signals,-Oh,-My!.html">previous post</a>.
</p>
<blockquote>
Earlier this year, I <a href="http://weierophinney.net/matthew/archives/251-Aspects,-Filters,-and-Signals,-Oh,-My!.html">wrote about Aspects, Intercepting Filters, Signal Slots, and Events</a>, in order to compare these similar approaches to handling both asychronous programming as well as handling cross-cutting application concerns in a cohesive way. I took the research I did for that article, and applied it to what was then a "SignalSlot" implementation within Zend Framework 2, and refactored that work into a new "EventManager" component. This article is intended to get you up and running with it.
</blockquote>
<p>
You'll need to already have an install of the Zend Framework (v2) installed to follow along. He covers some of the basic terminology and the base code the rest of the tutorial's built from - a simple EventManager instance with a trigger on it. He moves on from there showing how to specify targets for the triggers, setting up global static listeners and listener aggregates as well as how to short circuit listener execution. He wraps up the post by applying all of the examples into one simple caching tool that responds to the trigger by either sending back a new instance or pulling the previously generated one from the cache.
</p>]]></description>
      <pubDate>Tue, 13 Sep 2011 09:25:32 -0500</pubDate>
    </item>
  </channel>
</rss>
