Phlyty\App::event PHP Method

event() public method

Sets the target to the App object instance, and, if a route has been matched, adds it to the instance.
public event ( ) : AppEvent
return AppEvent
    public function event()
    {
        $event = new AppEvent();
        $event->setTarget($this);
        if (-1 < $this->routeIndex) {
            $route = $this->routes[$this->routeIndex];
            $event->setRoute($route);
        }
        return $event;
    }