mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
8740db9582
- Isolated Http classes from router. - Removed getInstance from Request object - current router request should now be obtained through SimpleRouter::request(). - Fixed broken test cases. - Added test for regular expression match. - Updated documentation to reflect changes. - Added more helper examples to documentation. - Added helpers to demo-project. - Optimisations.
27 lines
539 B
PHP
27 lines
539 B
PHP
<?php
|
|
|
|
/**
|
|
* Custom router which handles default middlewares, default exceptions and things
|
|
* that should be happen before and after the router is initialised.
|
|
*/
|
|
|
|
namespace Demo;
|
|
|
|
use Pecee\SimpleRouter\SimpleRouter;
|
|
|
|
class Router extends SimpleRouter {
|
|
|
|
public static function start($defaultNamespace = null) {
|
|
|
|
// Load our helpers
|
|
require_once 'helpers.php';
|
|
|
|
// Load our custom routes
|
|
require_once 'routes.php';
|
|
|
|
// Do initial stuff
|
|
parent::start('\\Demo\\Controllers');
|
|
|
|
}
|
|
|
|
} |