diogof648/simple-php-router

A simple PHP router for your projects.

1.0.0 2024-11-06 13:20 UTC

This package is auto-updated.

Last update: 2025-06-14 15:48:17 UTC


README

A simple PHP router for your projects.

Installation

You can use this router in your project by installing it via Composer

composer require diogof648/simple-php-router

Usage

<?php

use Diogof648\SimplePhpRouter\Router;

Router::get('/home', function () {
    echo "Home";
});

Router::post(...);
Router::patch(...);
Router::put(...);
Router::delete(...);
Router::any(...);

// If no match
Router::noMatch();
// OR
Router::noMatch(function () {
    echo "Not Found";
});

Contributing

If you have any issues or ideas, feel free to open an issue—I’ll respond as quickly as possible!

Pull requests are warmly welcomed. Make sure to update the tests !!

License

MIT