Initializes the Router and routes the requests to Dispatcher.
/** * 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; } }
/** * @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/'); }