Download the PHP package yeremi/route-mapper without Composer
On this page you can find all versions of the php package yeremi/route-mapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yeremi/route-mapper
More information about yeremi/route-mapper
Files in yeremi/route-mapper
Package route-mapper
Short Description A PHP library for mapping and resolving routes using attributes.
License MIT
Informations about the package route-mapper
RouteMapper
RouteMapper is a lightweight PHP library designed to leverage PHP 8 attributes to map and resolve API routes effortlessly. Whether you’re building APIs or integrating with existing systems, RouteMapper simplifies the routing process, offering flexibility and customizability without the overhead of a full framework.
Key Features
- Attribute-Based Routing: Define routes directly in your classes and methods using PHP 8 attributes.
- Lightweight and Framework-Agnostic: Perfect for standalone projects or as a complement to frameworks like Slim or Mezzio.
- Simple Integration: Easily integrate with tools like Guzzle or other HTTP clients.
- Customizable and Flexible: Full control over routing logic and resolution.
- No Bloat: Focused functionality without unnecessary dependencies.
Why Use RouteMapper?
-
Lightweight and Focused
- Unlike heavy frameworks, RouteMapper solves a specific problem: mapping routes with attributes. Ideal for small-to-medium projects or as a complement to other tools.
-
Easy Integration
- RouteMapper can integrate seamlessly with HTTP clients (like Guzzle) or middleware-based frameworks, making it adaptable for various use cases.
-
Customizability
- Developers retain full control of routing behavior while benefiting from the simplicity of attribute-based route definitions.
- Practicality for Modern PHP
- Embraces PHP 8 features, such as attributes and strict typing, ensuring modern, clean, and maintainable code.
Installation
Install RouteMapper via Composer:
Example Usage
Setup
Comparison with Other Solutions
Feature | RouteMapper | Symfony Routing | Laravel Routing | Slim Framework |
---|---|---|---|---|
Focus on Attributes | Yes | Yes | No | No |
Framework-Agnostic | Yes | No | No | Yes |
Lightweight | Yes | Moderate | No | Yes |
Customization | High | Moderate | Low | High |
Acknowledgments
Inspired by the flexibility of modern PHP attributes and the simplicity of middleware-based frameworks.
License
RouteMapper is licensed under the MIT License. See the LICENSE file for details.