Initializes the Router and routes the requests to Dispatcher.
Inheritance: use trait Webiny\Component\StdLib\SingletonTrait, use trait Webiny\Component\StdLib\StdObjectTrait, use trait Webiny\Component\Http\HttpTrait, use trait Webiny\Component\Router\RouterTrait
示例#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;
     }
 }
示例#2
0
 /**
  * @expectedExceptionMessage The provided callback class
  * @expectedException \Webiny\Component\Bootstrap\BootstrapException
  */
 public function testMvcRouterException()
 {
     \Webiny\Component\Bootstrap\Router::getInstance()->mvcRouter('/invalid-module/my-ctrl/my-act/');
 }