[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:
Simon Sessingø
2015-10-18 23:18:58 +02:00
parent b3b362a9e6
commit c1a6c63dc7
3 changed files with 64 additions and 36 deletions
+12
View File
@@ -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.
*