phpBB

Development Wiki

Difference between revisions of "Events"

From phpBB Development Wiki

Redirect page
(Changes as per igorw on IRC)
(Redirected page to Category:Events and Listeners)
Line 1: Line 1:
==What are events?==
+
#REDIRECT [[Category:Events_and_Listeners]]
Events are triggered in various places of the core phpBB code. Listeners in extensions can be subscribed to these events. They are able to execute code whenever the respective event has occured.  For more information, see the wiki article for [[listeners]].
+
 
+
Former names for events are "hook location" and "ledge".
+
 
+
==Why do we need events?==
+
Events allow extensions to execute code in many locations within core phpBB code, without modifying any of the code. That way extensions can add features, remove functionality or modify behaviour easily and while maintaing easy compatability and simple update procedures.
+
 
+
== Naming ==
+
 
+
{|
+
|-
+
! Name !! Explanation
+
|-
+
| [[Events]] || Events are triggered in various places of the core phpBB code. Listeners in extensions subscribe to these events. They are able to execute code whenever the respective event has occured.  For more information, see the wiki article for [[listeners]].
+
|-
+
| [[Listeners]] || Listeners are triggered by events. They can process incoming data and manipulate variables in the scope of the event. So they can change phpBB's behaviour, add new functionality or if used in the context of templates, modify the output. An alternative name for listeners are "hooks".
+
|-
+
| Subscriber || A subscriber registers [[listeners]] on the dispatcher.
+
|-
+
| Dispatcher || The event dispatcher calls the [[listeners]] for a certain event when that event is triggered.
+
|}
+
 
+
 
+
[[Category:Events and Listeners]]
+

Revision as of 14:22, 20 March 2012