Wallogit.com
2017 © Pedro Peláez
Translates request URIs into method calls.
Translate requests into method calls., (*1)
{
"require": {
"windy/lazyrouter": "dev-master"
}
}
Note: Make sure you redirect all requests to a single index.php., (*2)
An example index.php, (*3)
<?php
require_once 'Router.php';
use lazyrouter\Router;
$router = new Router();
$router->route(function() {}, function() {});
A request such as 'hello/world' would be interpreted as., (*4)
require_once 'controllers/hello.php'; $controller = new hello(); $controller->world();
Namespaces are permitted as well. Something like 'foo/bar/baz' would be interpreted as., (*5)
require_once 'controllers/bar.php'; $controller = new foo\bar(); $controller->baz();