2017 © Pedro Peláez
 

library fruit

image

mikeismint/fruit

  • Friday, April 7, 2017
  • by mikeismint
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Fruit.php

My first attempt at a simple PHP router. Influenced by AltoRouter, (*1)

Usage


$router = new Fruit(); // map single route $router->addRoute('GET', '/', 'Controller#Method'); // map post details page $router->addRoute('GET', '/^posts\/id\/(?P<id>\d+)$/', 'Controller#Method'); // map multiple routes $router->addRoutes(array( array('GET', '/', 'Controller#Method'), array('GET', '/^posts\/id\/(?P<id>\d+)$/', 'Controller#Method'), ));

Other features

  • Accepts multiple HTTP methods separated by |
  • Uses regex to match URL pattern
  • Accepts optional fourth parameter to name routes

The Versions

07/04 2017

dev-master

9999999-dev

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

routing router