EN FR

Overview

A PHP routing library built on top of the Symfony Routing component. It provides a clean and intuitive API for managing routes, generating URLs, and handling HTTP requests.

Features

  • Built on the Symfony Routing component for robust routing capabilities
  • Generate routes programmatically and export to YAML format
  • Load routes from YAML files with support for multiple file sources
  • Route matching with automatic request parameter parsing
  • URL generation for named routes (relative and absolute)
  • Redirect path management for legacy URL handling
  • Support for JSON endpoints with automatic format detection
  • HTTP method constraints (GET, POST, etc.)
  • Route parameter requirements and defaults
  • Immutable route collections for read-only configurations
  • Type-safe with PHP 8.2+ features

Installation

composer require jdz/router