mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-26 13:09:15 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cb7086e96 | |||
| a2edc1504c | |||
| d31cda8e70 | |||
| 921f050a31 |
@@ -1,5 +1,5 @@
|
||||
# Simple PHP router
|
||||
Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router.
|
||||
Simple, fast and yet powerful PHP router that is easy to get integrated and in any project. Heavily inspired by the Laravel router.
|
||||
|
||||
## Installation
|
||||
Add the latest version pf Simple PHP Router to your ```composer.json```
|
||||
@@ -33,7 +33,7 @@ Add the latest version pf Simple PHP Router to your ```composer.json```
|
||||
|
||||
- Global Constraints
|
||||
- Sub-Domain Routing
|
||||
- Required parameters
|
||||
- Optional parameters
|
||||
|
||||
## Initialising the router
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class RouterRoute extends RouterEntry {
|
||||
// Check if url parameter count matches
|
||||
if(stripos($url, $routeMatch) === 0) {
|
||||
|
||||
$matches = (count(explode('/', rtrim($url, '/'))) == count(explode('/', rtrim($route, '/'))));
|
||||
$matches = true;
|
||||
|
||||
if($this->regexMatch) {
|
||||
$parameters = $this->parseParameters($url, true, $this->regexMatch);
|
||||
@@ -61,6 +61,8 @@ class RouterRoute extends RouterEntry {
|
||||
|
||||
} else {
|
||||
|
||||
$matches = (count(explode('/', rtrim($url, '/'))) == count(explode('/', rtrim($route, '/'))));
|
||||
|
||||
$url = explode('/', $url);
|
||||
$route = explode('/', rtrim($route, '/'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user