hkuan/hrouter

Simple PHP router class.

dev-master 2017-05-19 01:54 UTC

This package is not auto-updated.

Last update: 2025-05-25 06:35:21 UTC


README

HRouter is a simple, open source PHP router. It's super small (~150 LOC), fast, and has some great annotated source code. This class allows you to just throw it into your project and start using it immediately.

Install

If you have Composer, just include Macaw as a project dependency in your composer.json. If you don't just install it by downloading the .ZIP file and extracting it to your project directory.

require: {
    "hkuan/hrouter": "dev-master"
}

Examples

First, use the Macaw namespace:

use /Hkuan/Hrouter\Router;

Hrouter is not an object, so you can just make direct operations to the class. Here's the Hello World: