Skip to content

Commit 5deb11f

Browse files
committed
docs: update docs
1 parent 47b8493 commit 5deb11f

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

user_guide_src/source/incoming/filters.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,9 @@ Filters are executed in the following order:
200200

201201
.. note:: Prior to v4.5.0, the filters that are specified to a route
202202
(in **app/Config/Routes.php**) are executed before the filters specified in
203-
**app/Config/Filters.php**. See
204-
:ref:`Upgrading Guide <upgrade-450-filter-execution-order>` for details.
203+
**app/Config/Filters.php**. And the After Filters in Route filters and Filters
204+
filters execution order were not reversed.
205+
See :ref:`Upgrading Guide <upgrade-450-filter-execution-order>` for details.
205206

206207
******************
207208
Confirming Filters

user_guide_src/source/installation/upgrade_450.rst

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,46 @@ Filter Execution Order
3131
======================
3232

3333
The order in which Controller Filters are executed has changed.
34+
If you wish to maintain the same execution order as in previous versions, set
35+
``true`` to ``Config\Feature::$oldFilterOrder``. See also :ref:`filter-execution-order`.
3436

35-
Before Filters::
37+
1. The order of execution of filter groups has been changed.
3638

37-
Previous: route → globals → methods → filters
38-
Now: globals → methods → filters → route
39+
Before Filters::
3940

40-
After Filters::
41+
Previous: route → globals → methods → filters
42+
Now: globals → methods → filters → route
4143

42-
Previous: route → globals → filters
43-
Now: route → filters → globals
44+
After Filters::
4445

45-
If you wish to maintain the same execution order as in previous versions, set
46-
``true`` to ``Config\Feature::$oldFilterOrder``. See also :ref:`filter-execution-order`.
46+
Previous: route → globals → filters
47+
Now: route → filters → globals
48+
49+
2. The After Filters in *Route* filters and *Filters* filters execution order is now
50+
reversed.
51+
52+
When you have the following configuration:
53+
54+
.. code-block:: php
55+
56+
// In app/Config/Routes.php
57+
$routes->get('/', 'Home::index', ['filter' => ['route1', 'route2']]);
58+
59+
// In app/Config/Filters.php
60+
public array $filters = [
61+
'filter1' => ['before' => '*', 'after' => '*'],
62+
'filter2' => ['before' => '*', 'after' => '*'],
63+
];
64+
65+
Before Filters::
66+
67+
Previous: route1 → route2 → filter1 → filter2
68+
Now: filter1 → filter2 → route1 → route2
69+
70+
After Filters::
71+
72+
Previous: route1 → route2 → filter1 → filter2
73+
Now: route2 → route1 → filter2 → filter1
4774

4875
Removed Deprecated Items
4976
========================

0 commit comments

Comments
 (0)