Download the PHP package celiovmjr/simplerouter without Composer
On this page you can find all versions of the php package celiovmjr/simplerouter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download celiovmjr/simplerouter
More information about celiovmjr/simplerouter
Files in celiovmjr/simplerouter
Download celiovmjr/simplerouter
More information about celiovmjr/simplerouter
Files in celiovmjr/simplerouter
Vendor celiovmjr
Package simplerouter
Short Description A lightweight, easy-to-use PHP router for building web applications.
License MIT
Package simplerouter
Short Description A lightweight, easy-to-use PHP router for building web applications.
License MIT
Please rate this library. Is it a good library?
Informations about the package simplerouter
SimpleRouter
SimpleRouter is a PHP class for managing routes in a PHP web application in a simple and effective manner.
Installation
To use SimpleRouter, simply include the Router.php
file in your PHP project and configure the appropriate autoloading.
Example Usage
Initial Setup
Defining Routes
Basic Routes
Route Groups and Subgroups
Naming Routes
Running the Application
Available Methods
- get($uri, $handler): Defines a GET route.
- post($uri, $handler): Defines a POST route.
- put($uri, $handler): Defines a PUT route.
- patch($uri, $handler): Defines a PATCH route.
- delete($uri, $handler): Defines a DELETE route.
- group($prefix, $handler): Defines a route group with a prefix.
- subgroup($prefix, $handler): Defines a subgroup of routes within an existing group.
- dispatch(): Executes routing and processes the corresponding route.
- route($name): Returns the URI associated with a named route.
- error(): Returns an stdClass object with error information, if any.
Benefits
- Modular Routing: Easily organize routes into groups and subgroups to maintain a structured application architecture.
- Flexible Routing: Supports dynamic and static routes, closures, and controller methods.
- Error Handling: Provides error handling for route dispatching failures.
All versions of simplerouter with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
The package celiovmjr/simplerouter contains the following files
Loading the files please wait ....