Download the PHP package power-modules/router without Composer
On this page you can find all versions of the php package power-modules/router. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download power-modules/router
More information about power-modules/router
Files in power-modules/router
Download power-modules/router
More information about power-modules/router
Files in power-modules/router
Vendor power-modules
Package router
Short Description A modular router component for the Power Modules framework with encapsulated routing capabilities and explicit module integration
License MIT
Package router
Short Description A modular router component for the Power Modules framework with encapsulated routing capabilities and explicit module integration
License MIT
Please rate this library. Is it a good library?
Informations about the package router
Modular Router
A modular router component for the Power Modules framework that provides HTTP routing capabilities with strict module encapsulation and dependency injection integration.
🔌 Perfect Integration: Built specifically for the Power Modules ecosystem with automatic route discovery, module-scoped controllers, and composable middleware stacks.
✨ Why Modular Router?
- 🏗️ Module-Centric: Routes are owned and defined by individual modules
- 🔒 Encapsulated Controllers: Controllers resolve from their originating module's DI container
- 🎯 Auto-Prefixing: Module names automatically become URL prefixes (
UserModule→/user/*) - 🧩 Composable Middleware: Module-level and route-level middleware stacking
- ⚡ Zero Configuration: Automatic route discovery with convention-based patterns
- 🛡️ Type-Safe: Full PHP 8.4+ type system integration with enums and strict typing
Quick Start
📚 Documentation
| Guide | Description |
|---|---|
| Getting Started | Build your first routed module in 5 minutes |
| Architecture | Module boundaries, container hierarchy, and request lifecycle |
| Use Cases | Web APIs, admin panels, plugin systems, and microservices |
| API Reference | Complete interface and class documentation |
| Advanced Patterns | Custom strategies, response decorators, and optimization |
Real-World Examples
Simple Module with Routes
Module with Custom Prefix
Module with Middleware Stack
🏗️ Architecture Highlights
Module Encapsulation
- Route Ownership: Each module defines its own routes via
HasRoutes - Controller Resolution: Controllers are resolved from their originating module's container
- Dependency Isolation: Module dependencies stay within module boundaries
Automatic Discovery
- Convention-Based:
UserModuleautomatically gets/user/*prefix - Zero Config: Routes are discovered and registered automatically during app build
- Override Ready: Implement
HasCustomRouteSlugfor custom prefixes
Middleware Composition
- Module-Level: Applied to all routes in the module
- Route-Level: Applied to specific routes only
- Resolution Context: Handlers and middleware resolve from their originating module container
Response Transformation
- Global Decorators: Applied to all responses
- Module-Level Decorators: Via
HasResponseDecoratorsinterface - Route-Level Decorators: Fluent API on
Routedefinitions
🚀 Features
Route Definition
Response Decorators
The router supports response decorators at three levels: global, module, and route.
Configuration System
🛠️ Development
Build Commands
Code Standards
- Strict Types:
declare(strict_types=1);on every file - PSR-12: Code style with additional rules (trailing commas, ordered imports)
- PHPStan Level 8: Maximum static analysis coverage
- PHP 8.4+: Latest language features and type system
🔌 Integration
Framework Dependencies
- Power Modules Framework: Core module system and DI container
- Laminas Diactoros: Default PSR-7 response implementation for native strategies
- PSR-7/PSR-15: HTTP message and middleware interfaces
Extension Points
- Custom Strategies: Replace default request/response handling
- Response Decorators: Global, module-level, and route-level response transformations
- Middleware Stacks: Composable request/response processing
- Route Prefixes: Custom URL organization patterns
📊 Use Cases
- 🌐 Web APIs: RESTful APIs with module-organized endpoints
- 🏢 Admin Panels: Admin interfaces with role-based middleware
- 🔌 Plugin Systems: Third-party module integration
- 🚀 Microservices: Service-oriented architectures
- 📱 Mobile Backends: API backends for mobile applications
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
MIT License. See LICENSE for details.
All versions of router with dependencies
PHP Build Version
Package Version
The package power-modules/router contains the following files
Loading the files please wait ...