News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matthew Weier O'Phinney's Blog:
Using the ZF2 EventManager
September 13, 2011 @ 09:25:32

Matthew Weier O'Phinney, lead on the Zend Framework project, has a new post to his blog talking about the event manager in the Zend Framework, v2 and how to use it in a refectored version of a previous post.

Earlier this year, I wrote about Aspects, Intercepting Filters, Signal Slots, and Events, 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.

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.

0 comments voice your opinion now!
zendframework v2 eventmanager tutorial framework component


blog comments powered by Disqus

Similar Posts

Jim Plush\'s Blog: Another PHP Framework that falls flat - PHP on Trax

Wojciech Sznapka's Blog: Loosening dependencies with closures in PHP

DevShed: Composing Messages in HTML for MIME Email with PHP

DevShed: The Basics of Implementing Adapter Objects with PHP

Padraic Brady's Blog: Zend_Service_Openid Is dead; But It's Reincarnation Is Coming


Community Events

Don't see your event here?
Let us know!


version opinion series language list framework release voicesoftheelephpant laravel5 example interview laravel podcast community php7 api security introduction extension library

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework