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
Afficher le fichier Open project: Webiny/Framework Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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.
Résultat Dispatcher

mvcRouter() public méthode

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