initializeRouter() public method

The method initializes router and tries to call the callback assigned to the current url. Method is call automatically from the Bootstrap class.
public initializeRouter ( string $url = null ) : Dispatcher
$url string Url to route. If not set, the current url is used.
return Dispatcher
Example #1
0
 /**
  * Initializes the router.
  *
  * @throws BootstrapException
  * @throws \Exception
  */
 public function initializeRouter()
 {
     try {
         // initialize router
         $this->router = Router::getInstance();
         // if a route is matched, a dispatcher instance is returned, and the callback is issued
         $this->router->initializeRouter()->issueCallback();
     } catch (BootstrapException $e) {
         throw $e;
     }
 }