News Feed
Sections




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

Alexander Netkachev's Blog:
Practical PHP events
October 24, 2006 @ 07:20:48

In his latest tutorial, Alexander Netkachev shows how to, with some of the simple PHP functions, create an event system for your script, complete with callbacks.

The way how events are raised and how listeners are attached on the events is a part of a core in many modern applications. It plays an important role in some enterprise design patterns (MVC, for example).

He starts with the basics of event handling - some of the terms and descriptions of basic functionality that any good event handler would have. He describes the most common setup of an event-interaction relationship. Then, it's on to the code, showing first three different ways to call functions (by name, by variable, and by callback).

He finishes it off with a functional example that responds to a a call to fireEvent (five times) and handles each by calling the function in the callback information (myFunction).

1 comment voice your opinion now!
event handline callback tutorial basics calling methods event handline callback tutorial basics calling methods


blog comments powered by Disqus

Similar Posts

PHPMaster.com: Under the Hood of Yii's Component Architecture, Part 1

Gergely Hodicska's Blog: What's new in PHP 5.3 - part 1: namespaces

Christoph Dorn's Blog: Profiling queries with Zend_Db_Profiler_Firebug

Zend Developer Zone: Accessing DB2 Data Inside of i5/OS

9Lessons.info: Facebook Style Tag Friends with Jquery, Ajax and PHP


Community Events





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


unittest configure introduction release series laravel threedevsandamaybe testing framework community install developer language refactor opinion list wordpress interview code podcast

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