setRoute() public method

Set matched route
public setRoute ( Route $route ) : AppEvent
$route Route
return AppEvent
示例#1
0
文件: App.php 项目: 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;
 }