Skip to content

Commit 59dc693

Browse files
committed
docs: update docs
1 parent 3f56a14 commit 59dc693

2 files changed

Lines changed: 38 additions & 10 deletions

File tree

‎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
@@ -24,19 +24,46 @@ Filter Execution Order
2424
======================
2525

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

28-
Before Filters::
30+
1. The order of execution of filter groups has been changed.
2931

30-
Previous: route → globals → methods → filters
31-
Now: globals → methods → filters → route
32+
Before Filters::
3233

33-
After Filters::
34+
Previous: route → globals → methods → filters
35+
Now: globals → methods → filters → route
3436

35-
Previous: route → globals → filters
36-
Now: route → filters → globals
37+
After Filters::
3738

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

4168
Removed Deprecated Items
4269
========================

0 commit comments

Comments
 (0)