Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samwho/php-routing
Rails-style routing for PHP.
https://github.com/samwho/php-routing
Last synced: 3 months ago
JSON representation
Rails-style routing for PHP.
- Host: GitHub
- URL: https://github.com/samwho/php-routing
- Owner: samwho
- License: other
- Created: 2011-05-17T22:35:59.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-04-15T12:36:22.000Z (almost 13 years ago)
- Last Synced: 2023-03-11T15:52:31.433Z (almost 2 years ago)
- Language: PHP
- Homepage:
- Size: 440 KB
- Stars: 17
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
# PHP Routing
This code is a PHP implementation of Rails-style URL routing. It is
intended to be a drop-in bit of code that you can use with any website.The project is an adaptation of the code found here:
http://blog.sosedoff.com/2009/09/20/rails-like-php-url-router/## Usage
To use this code you only need the two files under the lib/model/
directory: class.Router.php and class.Route.php. If you take these
two files, put them in your own project's code and make sure they're
included on the page you want to use them on, you're ready to go.The way that I recommend using this code is to take a look at the
.htaccess file in the same directory as this README. It will route
all requests that aren't to a currently existing file/directory
and send them to router.php and in router.php there are some usage
examples.## External Libraries
The project uses the SimpleTest library for PHP Unit Testing. This is
included with the source but you will not need it for normal use. You
will only need it if you wish to fork this repository and contribute
code.# Contributing
This project uses the [git-flow](https://github.com/nvie/gitflow) workflow. If
you want to contribute, fork the repository, create a feature branch, when
you're done issue a pull request to origin/develop :)