Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f20032a854 | ||
|
|
d4142655a5 |
@@ -10,7 +10,7 @@ Stable version
|
||||
composer require rmphp/router
|
||||
```
|
||||
```bash
|
||||
composer require rmphp/router:"^2.0"
|
||||
composer require rmphp/router:"^2.1"
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class Router implements RouterInterface {
|
||||
// заменяем алиасы на регвыражения
|
||||
$realPattern = str_replace(["<@any>", "<@num>", "<@path>"], [".*", "[0-9]+", "[^/]+"], $realPattern);
|
||||
// при наличии слеша в конце правила url должно строго ему соответствовать
|
||||
$end = (str_ends_with($realPattern, "/")) ? "$" : "";
|
||||
$end = (str_ends_with($realPattern, "/")) ? "$" : "/?$";
|
||||
|
||||
// меняем запись на паттерн
|
||||
$this->rules[$rulesKey] = $rulesNode;
|
||||
|
||||
Reference in New Issue
Block a user