2017 © Pedro Peláez
 

library router

Route http request to controller

image

seeren/router

Route http request to controller

  • Monday, April 2, 2018
  • by seeren
  • Repository
  • 0 Watchers
  • 0 Stars
  • 170 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Seeren\Router

Build Require Coverage Download Codacy Version, (*1)

Route http requests to controller actions, (*2)


Installation

composer require seeren/router

Seeren\Router\Router

namespace App\Controller;

use Seeren\Controller\JsonController;
use Seeren\Router\Route\Route;

class FooController extends JsonController
{

    #[Route("/path/(\d+)", "GET")]
    public function show(int $id)
    {
        return $this->render([]);
    }

}

Retrieve \Psr\Http\Message\ResponseInterface from a routed controller, (*3)

use Seeren\Router\Router;

$router = new Router();
$response = $router->getResponse();

Configuration

Router use container configuration to inject arguments as primitve: https://github.com/seeren/container#interfaces, (*4)

project/
└─ config/
   └─ services.json
   └─ routes.json

config/services.json, (*5)

{
  "parameters": {},
  "services": {}
}

Controllers are resolved using anotation by default or configuration file. Captured matches are passed to controller action that can either use autowire, (*6)

config/routes.json, (*7)

[
  {
    "path": "/path/(\\d+)",
    "controller": "App\\Controller\\FooController::show"
  }
]

License

This project is licensed under the MIT License, (*8)

The Versions

02/04 2018

dev-master

9999999-dev

Route http request to controller

  Sources   Download

MIT

The Requires

 

The Development Requires

psr-7 http route dispatcher request router psr-11 dispatche

02/04 2018

v2.0.2

2.0.2.0

Route http request to controller

  Sources   Download

MIT

The Requires

 

The Development Requires

http route request

05/08 2017
16/04 2017

v1.1.0

1.1.0.0

Router matching with psr-7

  Sources   Download

MIT

The Requires

 

The Development Requires

02/11 2016

1.0.4

1.0.4.0

Router matching with psr-7

  Sources   Download

MIT

The Requires

 

02/11 2016

1.0.3

1.0.3.0

Router matching with psr-7

  Sources   Download

MIT

The Requires

 

31/10 2016

v1.0.2

1.0.2.0

Router matching with psr-7

  Sources   Download

MIT

The Requires