mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 08:12:18 +00:00
@@ -57,7 +57,7 @@ require_once 'routes.php';
|
|||||||
* Can be overwritten by using the namespace config option on your routes.
|
* Can be overwritten by using the namespace config option on your routes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SimpleRouter::setDefaultNamespace('Demo\Controllers');
|
SimpleRouter::setDefaultNamespace('\Demo\Controllers');
|
||||||
|
|
||||||
// Start the routing
|
// Start the routing
|
||||||
SimpleRouter::start();
|
SimpleRouter::start();
|
||||||
@@ -150,7 +150,7 @@ SimpleRouter::get('/page/404', 'ControllerPage@notFound', ['as' => 'page.notfoun
|
|||||||
|
|
||||||
#### ExceptionHandler example
|
#### ExceptionHandler example
|
||||||
|
|
||||||
This is a basic example of an ExceptionHandler implementation:
|
This is a basic example of an ExceptionHandler implementation (please see "[Easily overwrite route about to be loaded](#easily-overwrite-route-about-to-be-loaded)" for examples on how to change callback).
|
||||||
|
|
||||||
```php
|
```php
|
||||||
namespace Demo\Handlers;
|
namespace Demo\Handlers;
|
||||||
@@ -259,7 +259,7 @@ class Router extends SimpleRouter {
|
|||||||
require_once 'routes.php';
|
require_once 'routes.php';
|
||||||
|
|
||||||
// change default namespace for all routes
|
// change default namespace for all routes
|
||||||
parent::setDefaultNamespace('\Demo');
|
parent::setDefaultNamespace('\Demo\Controllers');
|
||||||
|
|
||||||
// Do initial stuff
|
// Do initial stuff
|
||||||
parent::start();
|
parent::start();
|
||||||
|
|||||||
Reference in New Issue
Block a user