Phlyty\AppEvent::setRoute PHP Method

setRoute() public method

Set matched route
public setRoute ( Route $route ) : AppEvent
$route Route
return AppEvent
    public function setRoute(Route $route)
    {
        $this->route = $route;
        return $this;
    }

Usage Example

Exemplo n.º 1
0
Arquivo: App.php Projeto: phly/phlyty
 /**
  * Create and return an application event instance
  *
  * Sets the target to the App object instance, and, if a route has been
  * matched, adds it to the instance.
  *
  * @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;
 }