Rouph
ROUter for PHp
This is a simple library to call controller component of the MVC (Model View and Controller) architecture pattern, this library does the routing in the project.
This package is compatible with PSR-1, PSR-2 and PSR-4.
Structure
This is the directory structure.
build/
docs/
example/
src/
tests/
vendor/
Install
Via Composer.
$ composer require vitorteccom/rouph
Usage
This is minimal example.
require __DIR__ .'/vendor/autoload.php';
use Vitorteccom\Rouph\Router;
$router = new Router;
$router->set(
'GET|POST',
'DEFAULT',
'Vitorteccom\Example\Pages@notFound'
);
$router->set(
'ALL',
'/',
'Vitorteccom\Example\Pages@home'
);
$router->set(
'GET|PUT',
'/page',
'Vitorteccom\Example\Pages@page'
);
$router->run();
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
Test with PHPUnit, we also recommend Xdebug.
$ composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email contato@vitortec.com
instead of using the issue tracker.
Credits
License
GPLv3. Please see License File for more information.