2017 © Pedro Peláez
 

library router

Simple router based on PSR-7 HTTP Message recommendation

image

drmvc/router

Simple router based on PSR-7 HTTP Message recommendation

  • Wednesday, April 18, 2018
  • by EvilFreelancer
  • Repository
  • 2 Watchers
  • 1 Stars
  • 186 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 22 % Grown

The README.md

Latest Stable Version Build Status Total Downloads License PHP 7 ready Code Climate Scrutinizer CQ, (*1)

DrMVC\Router

Simple router based on PSR-7 HTTP Message recommendation., (*2)

composer require drmvc/router

How to use

More examples you can find here., (*3)

<?php
require_once __DIR__ . '/../vendor/autoload.php';

use Zend\Diactoros\ServerRequestFactory as ServerRequest;
use Zend\Diactoros\Response as ServerResponse;
use DrMVC\Router;

// PSR Request and Response
$request = ServerRequest::fromGlobals();
$response = new ServerResponse();

// Router object
$router = new Router($request, $response);

// Set routes
$router
    ->get('/aaa/<action>/<action2>', DrMVC\Controllers\Index::class)
    ->get('/bbb/zzz/ccc', 'App\Controllers\Index:default')
    ->get(
        '/action/zzz',
        function() {
            echo "action\n";
        }
    );

$route = $router->getRoute();
print_r($route);

About PHP Unit Tests

First need to install all dev dependencies via composer update, then you can run tests by hands from source directory via ./vendor/bin/phpunit command., (*4)

Links

The Versions

18/04 2018

dev-master

9999999-dev https://drmvc.com/

Simple router based on PSR-7 HTTP Message recommendation

  Sources   Download

MIT

The Requires

 

The Development Requires

psr-7 router

10/04 2018

3.0.4

3.0.4.0 https://drmvc.com/

Simple router based on PSR-7 HTTP Message recommendation

  Sources   Download

MIT

The Requires

 

The Development Requires

psr-7 router

07/04 2018

3.0.3

3.0.3.0 https://drmvc.com/

Simple router based on PSR-7 HTTP Message recommendation

  Sources   Download

MIT

The Requires

 

The Development Requires

psr-7 router

02/04 2018
29/03 2018
28/03 2018