This repository has been archived on 2025-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
2025-04-03 15:07:10 +00:00
2023-03-23 08:13:57 +00:00
2025-03-26 20:10:44 +00:00
2023-03-21 21:41:02 +01:00
2025-04-03 15:07:10 +00:00
2025-04-03 09:24:08 +00:00

Route

Minimalistic Web Application Router

Installation

Composer

Composer needs to know where to locate the package. Add the repository to your project by declaring it in the composer.json file.

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://git.willy.club/WillySoft/Route"
        }
    ],
    "require": {
        "willysoft/route": "dev-master"
    }
}

Fetch the package by running

composer install

Manual

Its all in a single file; include it in your project like so

require '/change_this/Route.php'

Usage

See example.php

Access directly

The simplest way to access your routes. Just put the file in your favorite folder and run it!

For example

http://your.site/folder/index.php/route

Rewrite requests

The more sexy way of doing it.

For example

http://your.site/route

NGINX

With PHP already configured, add this to the server block of your configuration to make requests that don't match a file on your server to be sent to your front controller and begin routing.

location / {
    try_files $uri $uri/ /index.php?$query_string;
}
Description
Minimal PHP Router
Readme WTFPL 64 KiB
Languages
PHP 100%