Example #1
0
 /**
  * Register Route in this Router.
  * 
  * Method can be used in chain.
  * 
  * @param string Key at witch Route will be available in method url()
  * @retrun self
  */
 public function addRoute($id, Route $route)
 {
     $prefix = $route->getPrefix();
     if (!isset($this->routes[$prefix])) {
         $this->routes[$prefix] = [];
     }
     $this->routes[$prefix][] = [$route, $id];
     $this->urls[$id] = $route;
     return $this;
 }