rduuke/router

PHP-friendly route system

v1.0.1 2016-12-15 02:24 UTC

This package is auto-updated.

Last update: 2024-12-11 01:39:10 UTC


README

Installation

It's recommended that you use Composer to install.

$ composer require rduuke/router

Rduuke/Router requires PHP 5.5.0 or newer.

Usage

Create an index.php file with the following contents:

<?php

require 'vendor/autoload.php';

$app = new RDuuke\Router\Router();

$app->get('/', function (){
   echo "Welcome RDuuke\\Router";
});

$app->run();

You may quickly test this using the built-in PHP server:

$ php -S localhost:8080

Going to http://localhost:8080/ will now display "Welcome RDuuke\Router".

Tests

To execute the test suite, you'll need phpunit.

$ phpunit