2017 © Pedro Peláez
 

library simple-route

A super simple routing class

image

daniel-griffiths/simple-route

A super simple routing class

  • Friday, December 15, 2017
  • by Daniel-Griffiths
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Simple Route

A super simple router for mapping a url to a method on a class., (*1)

Installation

Via Composer, (*2)

composer require daniel-griffiths/simple-route

Usage

<?php

require __DIR__.'/vendor/autoload.php';

$router = new DanielGriffiths\Router($_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI']);

// long form for binding a route, supports get/post requests
$router->add('GET', '/this-is-a-test', 'ExampleClassName@ExampleMethod');

// short hand for binding a route 
$router->get('/this-is-a-test', 'ExampleClassName@ExampleMethod');
$router->post('/this-is-a-test', 'ExampleClassName@ExampleMethod');

$router->dispatch();

The Versions

15/12 2017

dev-master

9999999-dev https://github.com/daniel-griffiths/simple-route

A super simple routing class

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

php route routing simple router daniel-griffiths

27/06 2017

v1.0.0

1.0.0.0 https://github.com/daniel-griffiths/simple-route

A super simple routing class

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

php route routing simple router daniel-griffiths