Download the PHP package mark-veres/bedouin without Composer
On this page you can find all versions of the php package mark-veres/bedouin. 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 bedouin
bedouin
A file-based PHP routing system.
Two files:
cartograph.php
script that generates the map filebedouin.php
script that routes according to the map file
installation
example setup
usage
- copy the
bedouin.php
andcartograph.php
files in the desired directory - create the
routes
andstatic
directory - create an
index.php
file will handle all requests - redirect all requests to
index.php
- create another PHP file that will use the cartograph API to generate the map
directory structure
file | url | method |
---|---|---|
/routes/index.php |
/ |
all |
/routes/index.get.php |
/ |
get |
/routes/about.php |
/about |
all |
/posts/index.php |
/posts |
all |
/posts/[slug]/index.php |
/posts/test /posts/bla-bla |
all |
/posts/[slug]/new.post.php |
/posts/test/new |
post |
404 pages
- create a
404.php
file in theroutes
folder - this file does not support custom HTTP methods
static files
- put all your static files in the
static
directory - access these files at the
/static/*
url - file names are case- and extension-sensitive
accessing route parameters
- given a route
/posts/[slug]
- and an url
/posts/test
middleware
- create a file ending in
.mw.php
or.mw.get.php
(or any HTTP method for that matter) - the middleware will be "bound" to the index handler of the directory it is placed in
[!NOTE] coming soon:
- map splits (performance optimization when dealing with many routes)
- templates
[!TIP] Redirecting all requests to
bedouin.php
on an Apache server.[!TIP] Redirecting all requests to
bedouin.php
with the PHP built-in server[!TIP] Regenerating the map by accessing a specific route.
All versions of bedouin with dependencies
PHP Build Version
Package Version
No informations.
The package mark-veres/bedouin contains the following files
Loading the files please wait ....