mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-10 23:32:15 +00:00
[BUGFIX] Bugfixes
This commit is contained in:
@@ -70,7 +70,7 @@ abstract class RouterEntry {
|
||||
* @return self
|
||||
*/
|
||||
public function setPrefix($prefix) {
|
||||
$this->prefix = trim($prefix, '/');
|
||||
$this->prefix = '/' . trim($prefix, '/') . '/';
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -139,12 +139,26 @@ abstract class RouterEntry {
|
||||
return $settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $settings
|
||||
* @return self
|
||||
*/
|
||||
public function addSettings(array $settings) {
|
||||
array_merge($this->settings, $settings);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $settings
|
||||
* @return self
|
||||
*/
|
||||
public function setSettings($settings) {
|
||||
$this->settings = $settings;
|
||||
|
||||
if($settings['prefix']) {
|
||||
$this->setPrefix($settings['prefix']);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user