2017 © Pedro Peláez
 

library route

The route management package

image

rosem/route

The route management package

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Rosem route management

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

Structure

If any of the following are applicable to your project, then the directory structure should follow industry best practices by being named the following., (*2)

bin/        
config/
src/
tests/
vendor/

Install

Via Composer, (*3)

``` bash $ composer require rosem/route, (*4)


## Usage ``` php $router = new Rosem\Route\Router(); $router->addRoute('GET', '/user/{id:\d+}', 'handle') ->addMiddleware('Auth', ['setType' => 'digest']) ->addMiddleware('CSRF'); $result = $router->dispatch('GET', '/user/123'); echo $result === [ // HTTP status code 0 => 200, // Handler 1 => 'handle', // Middleware list 2 => [ 0 => [ 0 => 'Auth', 1 => [ 'setName' => 'digest', ] ], 1 => [ 0 => 'CSRF', 1 => [] ], ], // Variables list 3 => [ 'id' => '123', ], ];

Change log

Please see CHANGELOG for more information on what has changed recently., (*5)

Testing

bash $ composer test, (*6)

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details., (*7)

Security

If you discover any security related issues, please email iroman.via@gmail.com instead of using the issue tracker., (*8)

Credits

License

The MIT License (MIT). Please see License File for more information., (*9)

The Versions