Download the PHP package jblond/php-router without Composer
On this page you can find all versions of the php package jblond/php-router. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package php-router
PHP router
A simple PHP router class
Less than 300 lines of code with comments
Supports
- lambda URLs:
- :any Any sign
- :num Only numbers
- :all All characters
- :an A-Z a-z 0-9
- :url A-Z a-z 0-9 - _
- :hex hexadecimal
- Regex URLs e.g. /user/(.*)/edit
- Optional Subroutes
- Works in Subdirs, if you use
->set_basepath('/yoursubdir')
- Custom response headers
- download
- header(s)
- redirect
- 503 error
Install
Examples
Static routes
dynamic routes
Integration with other libraries aka using closure
Define 404 not found page
Responses
Optional Subpatterns
Optional route subpattern can be made of using ?
aftern the normal pattern.
For the regexpattern see https://regexper.com/#%2Fphonebook(%5C%2F%5BA-Za-z%5D%2B(%5C%2F%5BA-Za-z%5D%2B(%5C%2F%5BA-Za-z%5D%2B(%5C%2F%5B0-9-%5D%2B)%3F)%3F)%3F)%3F%2F
Also good for testing your regex: http://www.phpliveregex.com/ use preg_match
Apache rewrite config
with apache 2.4 you can use
All versions of php-router with dependencies
PHP Build Version
Package Version
Requires
php Version
>= 8.1
The package jblond/php-router contains the following files
Loading the files please wait ....