gui\Application::on PHP Method

on() public method

Returns the next avaible object ID
public on ( string $eventName, callable $eventHandler ) : void
$eventName string the name of the event
$eventHandler callable the callback
return void
    public function on($eventName, callable $eventHandler)
    {
        if (!array_key_exists($eventName, $this->eventHandlers)) {
            $this->eventHandlers[$eventName] = [];
        }
        $this->eventHandlers[$eventName][] = $eventHandler;
    }