gui\Application::on PHP 메소드

on() 공개 메소드

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