Download the PHP package gabrielbull/router without Composer
On this page you can find all versions of the php package gabrielbull/router. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download gabrielbull/router
More information about gabrielbull/router
Files in gabrielbull/router
Download gabrielbull/router
More information about gabrielbull/router
Files in gabrielbull/router
Vendor gabrielbull
Package router
Short Description A lightning fast router for PHP
License MIT
Homepage https://github.com/chriso/klein.php
Package router
Short Description A lightning fast router for PHP
License MIT
Homepage https://github.com/chriso/klein.php
Please rate this library. Is it a good library?
Informations about the package router
Router
- Flexible regular expression routing (inspired by Sinatra)
- A set of boilerplate methods for rapidly building web apps
- Almost no overhead => 2500+ requests/second
Getting started
- PHP 5.6.x is required
- Install Router using Composer (recommended) or manually
- Setup URL rewriting so that all requests are handled by index.php
- (Optional) Throw in some APC for good measure
Composer Installation
- Get Composer
- Require Router with
php composer.phar require gabrielbull/router
- Install dependencies with
php composer.phar install
Example
Hello World - Obligatory hello world example
Example 1 - Respond to all requests
Example 2 - Named parameters
Example 3 - So RESTful
Example 4 - Sending objects / files
$router->respond('/report/latest', function ($request, $response) { $response->file('/tmp/cached_report.zip'); }); twig {{ path.generate('homepage') }}
## API
Below is a list of the public methods in the common classes you will most likely use. For a more formal source
of class/method documentation, please see the [PHPdoc generated documentation](http://chriso.github.io/klein.php/docs/).
All versions of router with dependencies
PHP Build Version
Package Version
The package gabrielbull/router contains the following files
Loading the files please wait ....