Skip to content

Commit 72ebada

Browse files
authored
Merge pull request #643 from skipperbent/v5-release
V5 release
2 parents e5b5b08 + 4121011 commit 72ebada

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ You can donate any amount of your choice by [clicking here](https://www.paypal.c
8585
- [Registering new event](#registering-new-event)
8686
- [Custom EventHandlers](#custom-eventhandlers)
8787
- [Advanced](#advanced)
88-
- [Disable multiple route rendering](#disable-multiple-route-rendering)
88+
- [Multiple route rendering](#multiple-route-rendering)
8989
- [Restrict access to IP](#restrict-access-to-ip)
9090
- [Setting custom base path](#setting-custom-base-path)
9191
- [Url rewriting](#url-rewriting)
@@ -1492,11 +1492,12 @@ class DatabaseDebugHandler implements IEventHandler
14921492

14931493
# Advanced
14941494

1495-
## Disable multiple route rendering
1495+
## Multiple route rendering
14961496

1497-
By default the router will try to execute all routes that matches a given url. To stop the router from executing any further routes any method can return a value.
1497+
If you need multiple routes to be executed on the same url, you can enable this feature by setting `SimpleRouter::enableMultiRouteRendering(true)`
1498+
in your `routes.php` file.
14981499

1499-
This behavior can be easily disabled by setting `SimpleRouter::enableMultiRouteRendering(false)` in your `routes.php` file. This is the same behavior as version 3 and below.
1500+
This is most commonly used in advanced cases, for example in CMS systems where multiple routes needs to be rendered.
15001501

15011502
## Restrict access to IP
15021503

src/Pecee/Http/Response.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public function redirect(string $url, ?int $httpCode = null): void
3939
$this->httpCode($httpCode);
4040
}
4141

42+
// Gracefully end session (avoid any changes being lost)
43+
session_write_close();
44+
4245
$this->header('location: ' . $url);
4346
exit(0);
4447
}

src/Pecee/SimpleRouter/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class Router
122122
* When disabled the router will stop execution when first route is found.
123123
* @var bool
124124
*/
125-
protected $renderMultipleRoutes = true;
125+
protected $renderMultipleRoutes = false;
126126

127127
/**
128128
* Router constructor.

0 commit comments

Comments
 (0)