Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher::addListenerService
Adds a service as event listener
Signature
public function addListenerService(string
$eventName,
[array
$callback = 0,
[integer
$priority = 0]] )
Parameters
$eventName
—
string
- Event for which the listener is added
$callback
—
array
- The service ID of the listener service & the method
name that has to be called
$priority
—
integer
- The higher this value, the earlier an event listener
will be triggered in the chain.
Defaults to 0.
Errors/Exceptions
-
InvalidArgumentException