From c8cb5cc09c7a38d5bb4d26ec3bfed1568480e12e Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 26 Sep 2023 16:23:37 +0900 Subject: [PATCH] docs: add changelog and upgrade --- user_guide_src/source/changelogs/v4.5.0.rst | 7 +++++ user_guide_src/source/incoming/routing.rst | 2 ++ .../source/installation/upgrade_450.rst | 31 +++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/user_guide_src/source/changelogs/v4.5.0.rst b/user_guide_src/source/changelogs/v4.5.0.rst index 3f509d73431f..ad22305f5cfd 100644 --- a/user_guide_src/source/changelogs/v4.5.0.rst +++ b/user_guide_src/source/changelogs/v4.5.0.rst @@ -27,6 +27,13 @@ Filter Execution Order The order in which Controller Filters are executed has changed. See :ref:`Upgrading Guide ` for details. +Nested Route Groups and Options +------------------------------- + +Due to a bug fix, the behavior has changed so that options passed to the outer +``group()`` are merged with the options of the inner ``group()``. +See :ref:`Upgrading Guide ` for details. + Others ------ diff --git a/user_guide_src/source/incoming/routing.rst b/user_guide_src/source/incoming/routing.rst index 74c8983e83d0..8b6aa927fa90 100644 --- a/user_guide_src/source/incoming/routing.rst +++ b/user_guide_src/source/incoming/routing.rst @@ -535,6 +535,8 @@ given route config options: .. literalinclude:: routing/027.php +.. _routing-nesting-groups: + Nesting Groups ============== diff --git a/user_guide_src/source/installation/upgrade_450.rst b/user_guide_src/source/installation/upgrade_450.rst index 7a4fbc0b29da..8ed4018e0e78 100644 --- a/user_guide_src/source/installation/upgrade_450.rst +++ b/user_guide_src/source/installation/upgrade_450.rst @@ -18,6 +18,37 @@ Mandatory File Changes Breaking Changes **************** +.. _upgrade-450-nested-route-groups-and-options: + +Nested Route Groups and Options +=============================== + +A bug that prevented options passed to outer ``group()`` from being merged with +options in inner ``group()`` has been fixed. + +Check and correct your route configuration as it could change the values of the +options applied. + +For example, + +.. code-block:: php + + $routes->group('admin', ['filter' => 'csrf'], static function ($routes) { + $routes->get('/', static function () { + // ... + }); + + $routes->group('users', ['namespace' => 'Users'], static function ($routes) { + $routes->get('/', static function () { + // ... + }); + }); + }); + +Now the ``csrf`` filter is executed for both the route ``admin`` and ``admin/users``. +In previous versions, it is executed only for the route ``admin``. +See also :ref:`routing-nesting-groups`. + Method Signature Changes ========================