Added namespacing
This commit is contained in:
parent
6674759d96
commit
545d321e0d
|
@ -12,6 +12,7 @@ The third argument will match the request method. The default method is 'get'.
|
|||
|
||||
## Simple example:
|
||||
```php
|
||||
use SteamPixel\Route;
|
||||
include 'Route.php';
|
||||
|
||||
Route::add('/user/([0-9]*)/edit', function($id) {
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace SteamPixel;
|
||||
|
||||
class Route {
|
||||
|
||||
private static $routes = Array();
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<?php
|
||||
|
||||
// Use this namespace
|
||||
use SteamPixel\Route;
|
||||
|
||||
// Include router class
|
||||
include 'Route.php';
|
||||
|
||||
function navi() {
|
||||
echo <<<EOD
|
||||
Navigation:
|
||||
|
@ -23,9 +29,6 @@ function navi() {
|
|||
EOD;
|
||||
}
|
||||
|
||||
// Include router class
|
||||
include 'Route.php';
|
||||
|
||||
// Add base route (startpage)
|
||||
Route::add('/', function() {
|
||||
navi();
|
||||
|
|
Loading…
Reference in New Issue
Block a user