vitorteccom/rouph

This is a simple router library for PHP.


Keywords
router, Vitortec.com, php
License
CNRI-Python-GPL-Compatible

Documentation

Rouph

ROUter for PHp

Software License Latest Version on Packagist Total Downloads Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status

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.