Skip to content

Commit 037b085

Browse files
committed
docs: update docs
1 parent 4184cb0 commit 037b085

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

user_guide_src/source/incoming/routing.rst

+9-1
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,15 @@ It is possible to nest groups within groups for finer organization if you need i
544544

545545
This would handle the URL at **admin/users/list**.
546546

547-
.. note:: Options passed to the outer ``group()`` (for example ``namespace`` and ``filter``) are not merged with the inner ``group()`` options.
547+
Options array passed to the outer ``group()`` are merged with the inner
548+
``group()`` options array. But note that if you specify the same key in the
549+
inner ``group()`` options, the value is overwritten.
550+
551+
The above code runs ``myfilter:config`` for ``admin``, and only ``myfilter:region``
552+
for ``admin/users/list``.
553+
554+
.. note:: Prior to v4.5.0, due to a bug, options passed to the outer ``group()``
555+
are not merged with the inner ``group()`` options.
548556

549557
.. _routing-priority:
550558

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22

3-
$routes->group('admin', static function ($routes) {
4-
$routes->group('users', static function ($routes) {
3+
$routes->group('admin', ['filter' => 'myfilter:config'], static function ($routes) {
4+
$routes->get('/', 'Admin\Admin::index');
5+
$routes->group('users', ['filter' => 'myfilter:region'], static function ($routes) {
56
$routes->get('list', 'Admin\Users::list');
67
});
78
});

0 commit comments

Comments
 (0)