Skip to main content

Installation

Requirements​

  • PHP 5.5 or higher
  • Composer

Install via Composer​

composer require php-compatible/router

Choose Your Routing Style​

Each routing style has its own getting started guide with server configuration and examples.

ApproachBest ForStyle
File-Based RoutingLegacy projects with existing PHP filesfile_router() in each file
Functional RoutingFull control, centralized routesrouter(), route(), url_path()
Modern RoutingClean syntax, new projectsRouter::get(), Router::post()