[ Index ]

PHP Cross Reference of DokuWiki




/inc/Extension/ -> Event.php (summary)

(no description)

File Size: 197 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Event:: (10 methods):

Class: Event  - X-Ref

The Action plugin event

__construct($name, &$data)   X-Ref
event constructor

param: string $name
param: mixed $data

__toString()   X-Ref

return: string

advise_before($enablePreventDefault = true)   X-Ref
advise all registered BEFORE handlers of this event

if these methods are used by functions outside of this object, they must
properly handle correct processing of any default action and issue an
advise_after() signal. e.g.
$evt = new dokuwiki\Plugin\Doku_Event(name, data);
if ($evt->advise_before(canPreventDefault) {
// default action code block

return: bool results of processing the event, usually $this->runDefault
param: bool $enablePreventDefault

advise_after()   X-Ref
advise all registered AFTER handlers of this event

param: bool $enablePreventDefault
see: advise_before() for details

trigger($action = null, $enablePrevent = true)   X-Ref

- advise all registered (<event>_BEFORE) handlers that this event is about to take place
- carry out the default action using $this->data based on $enablePrevent and
$this->_default, all of which may have been modified by the event handlers.
- advise all registered (<event>_AFTER) handlers that the event has taken place

return: mixed $event->results
param: null|callable $action
param: bool $enablePrevent

stopPropagation()   X-Ref

stop any further processing of the event by event handlers
this function does not prevent the default action taking place

mayPropagate()   X-Ref
may the event propagate to the next handler?

return: bool

preventDefault()   X-Ref

prevent the default action taking place

mayRunDefault()   X-Ref
should the default action be executed?

return: bool

createAndTrigger($name, &$data, $action = null, $canPreventDefault = true)   X-Ref
Convenience method to trigger an event

Creates, triggers and destroys an event in one go

return: mixed                        the event results value after all event processing is complete
param: string $name name for the event
param: mixed $data event data
param: callable $action (optional, default=NULL) default action, a php callback function
param: bool $canPreventDefault (optional, default=true) can hooks prevent the default action