Skip to content

Commit 9cad762

Browse files
committed
docs: add changelog and upgrade
1 parent 183c8af commit 9cad762

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

user_guide_src/source/changelogs/v4.5.0.rst

+10
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ BREAKING
2121
Behavior Changes
2222
================
2323

24+
Nested Route Groups and Options
25+
-------------------------------
26+
27+
Due to a bug fix, the behavior has changed so that options passed to the outer
28+
``group()`` are merged with the options of the inner ``group()``.
29+
See :ref:`Upgrading Guide <upgrade-450-nested-route-groups-and-options>` for details.
30+
31+
Others
32+
------
33+
2434
- **Logger:** The :php:func:`log_message()` function and the logger methods in
2535
``CodeIgniter\Log\Logger`` now do not return ``bool`` values. The return types
2636
have been fixed to ``void`` to follow the PSR-3 interface.

user_guide_src/source/incoming/routing.rst

+2
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,8 @@ given route config options:
535535

536536
.. literalinclude:: routing/027.php
537537

538+
.. _routing-nesting-groups:
539+
538540
Nesting Groups
539541
==============
540542

user_guide_src/source/installation/upgrade_450.rst

+31
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,37 @@ Mandatory File Changes
1818
Breaking Changes
1919
****************
2020

21+
.. _upgrade-450-nested-route-groups-and-options:
22+
23+
Nested Route Groups and Options
24+
===============================
25+
26+
A bug that prevented options passed to outer ``group()`` from being merged with
27+
options in inner ``group()`` has been fixed.
28+
29+
Check and correct your route configuration as it could change the values of the
30+
options applied.
31+
32+
For example,
33+
34+
.. code-block:: php
35+
36+
$routes->group('admin', ['filter' => 'csrf'], static function ($routes) {
37+
$routes->get('/', static function () {
38+
// ...
39+
});
40+
41+
$routes->group('users', ['namespace' => 'Users'], static function ($routes) {
42+
$routes->get('/', static function () {
43+
// ...
44+
});
45+
});
46+
});
47+
48+
Now the ``csrf`` filter is executed for both the route ``admin`` and ``admin/users``.
49+
In previous versions, it is executed only for the route ``admin``.
50+
See also :ref:`routing-nesting-groups`.
51+
2152
Method Signature Changes
2253
========================
2354

0 commit comments

Comments
 (0)