Download the PHP package delight-im/router without Composer
On this page you can find all versions of the php package delight-im/router. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download delight-im/router
More information about delight-im/router
Files in delight-im/router
Package router
Short Description Router for PHP. Simple, lightweight and convenient.
License MIT
Homepage https://github.com/delight-im/PHP-Router
Informations about the package router
PHP-Router
Router for PHP. Simple, lightweight and convenient.
Requirements
- PHP 5.6.0+
Installation
-
Include the library via Composer [?]:
- Include the Composer autoloader:
Usage
-
Enable URL rewriting on your web server
-
Apache (in
.htaccess
orhttpd.conf
) - Nginx (in
nginx.conf
)
-
-
Create a new
Router
instance-
for the web root
- for any subdirectory
-
-
Add some routes and map them to anonymous functions or closures
-
Static route:
-
Dynamic route (with parameters):
The values of parameters matched in the URL can be captured as arguments in the callback.
- Route with multiple supported request methods:
-
-
Map routes to controller methods instead for more complex callbacks
-
Inject arguments for access to further values and objects (prepended to those matched in the route)
and
Contributing
All contributions are welcome! If you wish to contribute, please create an issue first so that your feature, problem or question can be discussed.
License
This project is licensed under the terms of the MIT License.