Methods

getEventListeners()

getEventListeners() : array<mixed,\Phug\Event\ListenerQueue>

Returns current event listeners by event name.

Returns

array<mixed,\Phug\Event\ListenerQueue>

mergeEventListeners()

mergeEventListeners(array<mixed,\Phug\Event\ListenerQueue>  $eventListeners) : boolean

Merge current events listeners with a given list.

Parameters

array<mixed,\Phug\Event\ListenerQueue> $eventListeners

event listeners by event name

Returns

boolean —

true on success false on failure

attach()

attach(string  $event, callable  $callback, integer  $priority) : boolean

Attaches a listener to an event.

Parameters

string $event

the event to attach too

callable $callback

a callable function

integer $priority

the priority at which the $callback executed

Returns

boolean —

true on success false on failure

detach()

detach(string  $event, callable  $callback) : boolean

Detaches a listener from an event.

Parameters

string $event

the event to attach too

callable $callback

a callable function

Returns

boolean —

true on success false on failure

clearListeners()

clearListeners(string  $event) : void

Clear all listeners for a given event.

Parameters

string $event

trigger()

trigger(string|\Phug\EventInterface  $event, object|string  $target = null, array|object  $argv = array()) : mixed

Trigger an event.

Can accept an EventInterface or will create one if not passed

Parameters

string|\Phug\EventInterface $event
object|string $target
array|object $argv

Returns

mixed

hasOption()

hasOption(string|array  $name) : mixed

Parameters

string|array $name

Returns

mixed

getOption()

getOption(string|array  $name) : mixed

Parameters

string|array $name

Returns

mixed

setOption()

setOption(string|array  $name, mixed  $value) : $this

Parameters

string|array $name
mixed $value

Returns

$this

getOptions()

getOptions() : array

Returns

array

setOptions()

setOptions(array  $options) : $this

Parameters

array $options

Returns

$this

setOptionsRecursive()

setOptionsRecursive(array  $options) : $this

Parameters

array $options

Returns

$this

setOptionsDefaults()

setOptionsDefaults(array  $options) : $this

Parameters

array $options

Returns

$this

unsetOption()

unsetOption(string|array  $name) : $this

Parameters

string|array $name

Returns

$this

hasModule()

hasModule(  $className) 

Parameters

$className

getModule()

getModule(  $className) 

Parameters

$className

getModules()

getModules() 

getStaticModules()

getStaticModules() 

addModule()

addModule(  $className) 

Parameters

$className

addModules()

addModules(array  $classNames) 

Parameters

array $classNames

removeModule()

removeModule(  $className) 

Parameters

$className

getModuleBaseClassName()

getModuleBaseClassName()