Example #1
0
 /**
  * Attaches a router utility to this instance.
  *
  * @param \Fine47\MicroRouter\Interfaces\Router $router
  * @see \Fine47\MicroRouter\Routers\Files
  */
 public function setRouter(Interfaces\Router $router)
 {
     if (null !== $this->router) {
         $this->router->shutdown();
         $this->router = null;
     }
     $this->router = $router;
     Shutdown::getInstance()->register('router', [$this->router, 'shutdown'], Shutdown::PRIO_LATER);
     return $this->router;
 }