2017 © Pedro Peláez
 

library tinyrouter

Tiny PHP router based on Macaw.

image

tinylara/tinyrouter

Tiny PHP router based on Macaw.

  • Thursday, October 22, 2015
  • by JohnLui
  • Repository
  • 3 Watchers
  • 15 Stars
  • 556 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

TinyLara\TinyRouter

Latest Stable Version Total Downloads License, (*1)

TinyRouter is a tiny PHP router based on Macaw. Read the documentation., (*2)

Install

If you have Composer, just include TinyRouter as a project dependency in your composer.json. If you don't just install it by downloading the .ZIP file and extracting it to your project directory., (*3)

require: {
    "tinylara/tinyrouter": "*"
}

Examples

use TinyLara\TinyRouter\TinyRouter as Route;

Route::get('/', 'HomeController@home');

// GET
Route::get('foo', function() {
  echo "GET Foo!";
});
// POST
Route::post('foo', function() {
  echo "POST Foo!";
});
// ANY: GET or POST
Route::any('foo', function() {
  echo "ANY Foo!";
});

Route::error(function() {
  throw new Exception("404 Not Found");
});

Route::dispatch();

The Route::dispatch() function can receive a parameter as the Processor After. It will process the value returned by Controller. Example:, (*4)

Route::dispatch('View@process');


If you don't specify an error callback, it will just echo 404., (*5)

License

The TinyRouter is open-sourced software licensed under the MIT license, (*6)

The Versions

22/10 2015

dev-master

9999999-dev

Tiny PHP router based on Macaw.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by John Lui

22/10 2015

v2.2

2.2.0.0

Tiny PHP router based on Macaw.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by John Lui

15/03 2015

v2.1

2.1.0.0

Tiny PHP router based on Macaw.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

by John Lui

12/03 2015

v2.0

2.0.0.0

Tiny PHP router based on Macaw.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

by John Lui

08/03 2015

v1.1

1.1.0.0

Tiny PHP router based on Macaw.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

by John Lui

14/01 2015

v1.0

1.0.0.0

Tiny PHP router based on Macaw.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

by John Lui