2017 © Pedro Peláez
 

library router

Routing component designed for ease of use and speed. Built for Trident.

image

strident/router

Routing component designed for ease of use and speed. Built for Trident.

  • Friday, March 20, 2015
  • by Seer
  • Repository
  • 2 Watchers
  • 1 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Router

Build Status Coverage Code Climate, (*1)

Routing component designed for ease of use and speed. Built for Trident., (*2)

Installation

Installation is available via Composer. Add the package to your composer.json:, (*3)

$ composer require strident/router ~2.0

Usage

The Strident Router package is flexible and allows you to swap out components to extend it easier. To create a Router, do the following:, (*4)

use Strident\Router\RouteFactory;
use Strident\Router\RouteMatcher;
use Strident\Router\Router;

$factory = new RouteFactory();
$matcher = new RouteMatcher();
$router  = new Router($factory, $matcher);

From there, you can define routes like so:, (*5)

$router->route("route_name", "/route/path/{parameter}/{placeholders}")
    ->target("GET", "FooController::getAction")
    ->target("POST", "FooController::postAction")
;

The route() method of the Router returns the instance of a the created Route. The Route can then define it's targets for specific HTTP methods by using the target() method., (*6)

To dispatch the current request in the Router, use the dispatch() method of the Router., (*7)

$matched = $router->dispatch("GET", "/route/path/1/2");

The return value of dispatch() is an array containing information about the matched route. This includes the name of the route, the request method, the path, and the parameters (by name, and index)., (*8)

The Versions

20/03 2015

dev-master

9999999-dev https://github.com/Strident/Router

Routing component designed for ease of use and speed. Built for Trident.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

component router trident

22/02 2015

2.0.1

2.0.1.0 https://github.com/Strident/Router

Routing component designed for ease of use and speed. Built for Trident.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

component router trident

17/02 2015

dev-hack

dev-hack https://github.com/Strident/Router

Routing component designed for ease of use and speed. Built for Trident.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

component router trident

17/02 2015

2.0.0

2.0.0.0 https://github.com/Strident/Router

Routing component designed for ease of use and speed. Built for Trident.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

component router trident

17/02 2015

1.0.3

1.0.3.0 https://github.com/Strident/Router

Routing component designed for ease of use and speed. Built for Trident.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

component router trident

10/02 2015

1.0.2

1.0.2.0 https://github.com/Strident/Router

Routing component designed for ease of use and speed. Built for Trident.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

component router trident

10/02 2015

1.0.1

1.0.1.0 https://github.com/Strident/Router

Routing component designed for ease of use and speed. Built for Trident.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

component router trident

10/02 2015

1.0.0

1.0.0.0 https://github.com/Strident/Router

Routing component designed for ease of use and speed. Built for Trident.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

component router trident