mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
[FEATURE/BUGFIX] Improvements
- Added match method to match specific regular expression. - GetRoute now returns provided controller and method if no match is found. - Bugfixes and other minor improvements.
This commit is contained in:
@@ -23,6 +23,7 @@ abstract class RouterEntry {
|
||||
protected $callback;
|
||||
protected $parameters;
|
||||
protected $parametersRegex;
|
||||
protected $regexMatch;
|
||||
|
||||
public function __construct() {
|
||||
$this->settings = array();
|
||||
@@ -158,6 +159,17 @@ abstract class RouterEntry {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add regular expression match for url
|
||||
*
|
||||
* @param string $regex
|
||||
* @return self
|
||||
*/
|
||||
public function match($regex) {
|
||||
$this->regexMatch = $regex;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get settings that are allowed to be inherited by child routes.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user