An open API service indexing awesome lists of open source software.

https://github.com/four43/divergence

A fast router for PHP, as easy, or as full featured as you need it.
https://github.com/four43/divergence

Last synced: 5 months ago
JSON representation

A fast router for PHP, as easy, or as full featured as you need it.

Awesome Lists containing this project

README

          

Divergence Router
=================

A fast router for PHP, as easy, or as full featured as you need it.

Insipred by ToroRouter (https://github.com/anandkunal/ToroPHP), which is a great
router to quickly create simple apps. Divergence aims to be almost as simple, but
provide more features for larger apps.

Build Status
------------
Master: [![Build Status](https://travis-ci.org/four43/divergence.svg?branch=master)](https://travis-ci.org/four43/divergence)

Development: [![Build Status](https://travis-ci.org/four43/divergence.svg?branch=development)](https://travis-ci.org/four43/divergence)

Features
--------

* *Simple* - Single file rouder, commented and easy to understand.
* *Debug* - Provided debug handler, add it to your app temporarily to see what callbacks
get called when, and with what data.
* *Server Setup* - Use provided server configs (.htaccess for Apache and web.config for IIS) to route
all of your requests to your index.php file.

Example
-------

###Basic
```php
'RestV1\Controller\Action'
);
\Divegent\Router::serve($routes);
```
Will route `/v1/action/123` to the controller `RestV1\Controller\Action` based
on the method, `GET` will call the `get()` method as `get(123)`

###Basic - Callback