Composer Routing Libraries
Example
Using https://github.com/bramus/router
- Add
"bramus/router": "~1.4"
tocomposer.json
in the/croissant
folder.
{
"name": "Croissant/Croissant",
"description": "The Croissant Framework.",
"keywords": ["framework", "croissant"],
"license": "private",
"require": {
...
"bramus/router": "~1.4",
...
"smarty/smarty": "~3.1"
},
"config": {
},
"minimum-stability": "stable"
}
- There is a replacement
index.php
in thedocroot
folder calledrouter-index.php
. Remove the defaultindex.php
and renamerouter-index.php
toindex.php
. - Add your routes to this
index.php
file as per the documentation.