_____ _ _ _____ _____ _
| __ \| | | | __ \ | __ \ | |
| |__) | |__| | |__) | ______ | |__) |___ _ _| |_ ___ _ __
| ___/| __ | ___/ |______| | _ // _ \| | | | __/ _ \ '__|
| | | | | | | | | \ \ (_) | |_| | || __/ |
|_| |_| |_|_| |_| \_\___/ \__,_|\__\___|_|
simple Router class for PHP. with the support of Controllers and Middlewares.
- Supports GET, POST, PUT, DELETE, OPTIONS, PATCH, HEAD, AJAX and ANY request methods
- Controllers support (Example: HomeController@about)
- Before and after Route Middlewares support
- Static Route Patterns
- Dynamic Route Patterns
- Easy-to-use patterns
- Adding a new pattern supports. (with RegExp)
- Namespaces supports.
- Group Routing
- Custom 404 handling
- Debug mode (Error message open/close)
composer.json file:
{
"require": {
"izniburak/router": "^1"
}
}
after run the install command.
$ composer install
OR run the following command directly.
$ composer require izniburak/router
require 'vendor/autoload.php';
$router = new Buki\Router();
$router->get('/', function() {
return 'Hello World!';
});
$router->get('/controller', 'TestController@main');
$router->run();
Documentation page: Buki\Router Docs
- Write Test
- Write Documentation
- Fork it ( https://github.com/izniburak/php-router/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- izniburak İzni Burak Demirtaş - creator, maintainer