diff --git a/README.md b/README.md index fb0c02c..238ff1e 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,17 @@ -# Route2 +# Route2 🛣️ A simple routing system for PHP web applications. ### Features: -- Define routes for specific HTTP methods (GET, POST, PUT, DELETE, etc.). -- Apply middleware to routes or groups of routes. -- Group routes under a common prefix for better organization. -- Support for route parameters (e.g., `/user/$id`) and optional parameters (e.g., `/user/$id?`). +- **Simplicity**: Easily map URLs to specific callback functions. +- **Parameters**: Flexible URL handling with parameters (e.g., `/user/$id`). +- **Middleware**: Register functions to execute **before** and **after** routes. +- **Grouping**: Organize related routes and apply group-specific middleware. +- **Lightweight**: A single-file, no-frills routing solution with zero dependencies. ### Example: ```php -// Setup the routing context. This method must be called before defining any routes +// Initialize the router. This method must be called before defining any routes Route2::setup(); // Define a GET route @@ -58,7 +59,7 @@ Route2::group('/admin', function () { }); ``` -# Installation +## Installing ### Composer: @@ -88,14 +89,12 @@ Its all in a single file; include it in your project like so. require '/YourPath/Route2.php' ``` -# Usage +## Using Route2 To get started quickly you may copy this into your project. ### Classic mode -Defualt PHP behavior - ```php