Public Member Functions | |
| __construct ($server, $context) | |
| init ($server) | |
| serveUrl () | |
| routeAdd ($route, $controller) | |
| overrideUrl ($type, $value) | |
| __get ($key) | |
Private Member Functions | |
| createController ($className, $params) | |
| routeMatch ($request, $route) | |
| prepareUrl () | |
| doRouteAdd ($route, $controller) | |
Private Attributes | |
| $rootPath | |
| $rootUrl | |
| $requestUrl | |
| $routes | |
| $context | |
| $routeParams | |
| $overridden | |
Will manager new connections to the server and try to match the requests and the controllers
Definition at line 9 of file Router.php.
| __construct | ( | $server, | |
| $context | |||
| ) |
| __get | ( | $key | ) |
|
private |
Create and return Controller for the given route
| $className | ||
| array | $routeParameters |
Definition at line 141 of file Router.php.
|
private |
Add a route to the internal route list Internal procedure
Definition at line 204 of file Router.php.
| init | ( | $server | ) |
Called after database initialization Check the site url and redirect user if the HOST does not match If the site url is not defined in database, do not redirect
Definition at line 99 of file Router.php.
| overrideUrl | ( | $type, | |
| $value | |||
| ) |
Override url This SHOULD not be called for security purpose
| string | $type | the url type to override |
| string | $value | the new value Will fail if called from a controller |
Definition at line 234 of file Router.php.
|
private |
Append local routes to router Will load CMS pages, categories page, products page, cart pages, etc.
Definition at line 192 of file Router.php.
| routeAdd | ( | $route, | |
| $controller | |||
| ) |
| string | $route | Uri to match the controller Uri can be formatted as '/:param/static'. expl. '/product/:id/' |
| string | $controller | Controller class name. new $controller() MUST return a instance |
Add a route and a Controller to the list Can only be called from `routerSetup' hook
Definition at line 219 of file Router.php.
|
private |
Check if the request match route
| array | $request | User request |
| array | $route | Route to check |
Definition at line 166 of file Router.php.
| serveUrl | ( | ) |
Definition at line 118 of file Router.php.
|
private |
/core/tools/Context.php Contains website's informations
Definition at line 41 of file Router.php.
|
private |
contains url and paths to rewrite
Definition at line 57 of file Router.php.
|
private |
Contains request
Definition at line 29 of file Router.php.
|
private |
Contains the application's root path (ex: http://myshop.com/) with trailing slash Can be accessed read-only via $instance->rootPath
Contains the application's root path (ex: /srv/http/myshop/) with trailing slash Can be accessed read-only via $instance->rootUrl
Definition at line 16 of file Router.php.
|
private |
Definition at line 23 of file Router.php.
|
private |
Definition at line 51 of file Router.php.
|
private |
Definition at line 34 of file Router.php.
1.8.8