PHP Class Webiny\Component\Bootstrap\Router

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
Show file Open project: Webiny/Framework Class Usage Examples

Public Methods

Method Description
initializeRouter ( string $url = null ) : Dispatcher This is the request entry point, once the Bootstrap has been initialized.
mvcRouter ( string $request ) : Dispatcher This is the optional router that routes the MVC requests.

Private Methods

Method Description
dispatchCustom ( string $className, string $action, array $params ) : Dispatcher In case of a custom route, we must use the custom dispatcher.
dispatchMvc ( string $module, string $controller, string $action, array $params ) : Dispatcher Issues the callback using the MVC dispatcher.

Method Details

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

mvcRouter() public method

This is the optional router that routes the MVC requests.
public mvcRouter ( string $request ) : Dispatcher
$request string Current url path.
return Dispatcher