DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:event_handlers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
devel:event_handlers [2015-12-17 01:51]
samwilson [The Event Loop] Grammar of the phrase https://en.wikipedia.org/wiki/First-come,_first-served
devel:event_handlers [2015-12-17 01:53] (current)
samwilson [The Event Loop] Remove space before footnote superscript.
Line 11: Line 11:
 There are actually two lists: one for before and one for after  DokuWiki performs its own action. These are designated by the  ''BEFORE'' and ''AFTER'' keywords, used when registering for an event. Before processing its own action, DokuWiki loops through all the ''BEFORE'' requests,  making its own action the last to be processed. This gives your code the opportunity to act on this event before DokuWiki gets to it. In the case of [[devel:event:IO_WIKIPAGE_WRITE]], for instance, you can make changes to the page content before it gets sent to the browser.  There are actually two lists: one for before and one for after  DokuWiki performs its own action. These are designated by the  ''BEFORE'' and ''AFTER'' keywords, used when registering for an event. Before processing its own action, DokuWiki loops through all the ''BEFORE'' requests,  making its own action the last to be processed. This gives your code the opportunity to act on this event before DokuWiki gets to it. In the case of [[devel:event:IO_WIKIPAGE_WRITE]], for instance, you can make changes to the page content before it gets sent to the browser. 
  
-After performing its own action, DokuWiki loops through all the ''AFTER'' requests. In the case of the [[devel:event:TPL_ACT_RENDER]] event, for instance, it's possible to append content to the wiki page. ((Similarly, using ''BEFORE'', you can prepend content.))+After performing its own action, DokuWiki loops through all the ''AFTER'' requests. In the case of the [[devel:event:TPL_ACT_RENDER]] event, for instance, it's possible to append content to the wiki page.((Similarly, using ''BEFORE'', you can prepend content.))
  
 DokuWiki's action is the __default__. But during the ''BEFORE'' phase of some events, it's also possible to stop the default from taking place. Similarly, an event handler can short-circuit the event loop and prevent any handlers remaining on the stack from being executed. DokuWiki's action is the __default__. But during the ''BEFORE'' phase of some events, it's also possible to stop the default from taking place. Similarly, an event handler can short-circuit the event loop and prevent any handlers remaining on the stack from being executed.
devel/event_handlers.txt ยท Last modified: 2015-12-17 01:53 by samwilson