Download the PHP package elcapitansponge/phlounder without Composer
On this page you can find all versions of the php package elcapitansponge/phlounder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elcapitansponge/phlounder
More information about elcapitansponge/phlounder
Files in elcapitansponge/phlounder
Package phlounder
Short Description Minimalistc semi-opinionated PHP router
License MIT
Homepage https://github.com/ElCapitanSponge/phlounder
Informations about the package phlounder
PHlounder
Minimalistic opinionated PHP Routing engine
⇁ About
A minimalistic routing engine for PHP allowing route parameters for GET, POST, PUT, DELETE and OPTIONS. The only thing missing is your code.
⇁ Installation
Composer
Git
NOTE As this is still in development cloning the repo is the way to go.
or
⇁ Getting Started
Calling the library
Include the library in your script
Composer
Git Clone
Alternitively you can load the files using the following snippet
Using the library
An example implementation of phlounder is as follows
Route Handling
The routing due to the nature of implementation follows the order of precidence. In otherwords, a top to bottom approach when processing.
This is apparent with the following snippet:
In the above snippet if you hit /user/foo
You don't recieve:
Instead you recieve:
To resolve this issue we have to place the /user/foo
route before /user/{id}
Route paramater types
There is type handling for string
or int
in the route params if desired.
Taking the following:
/users/{id:i}
: Theid
param is specified to be anint
/course/{code:s}
: Thecode
param is specified to be astring
/category/{id}
: Theid
param can be either astring
or anint