Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix incorrect description for route group filter #8978

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions user_guide_src/source/incoming/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,14 @@ It is possible to nest groups within groups for finer organization if you need i

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

**Filter** option passed to the outer ``group()`` are merged with the inner
The ``filter`` option passed to the outer ``group()`` are merged with the inner
``group()`` filter option.
The above code runs ``myfilter:config`` for the route ``admin``, and ``myfilter:config``
and ``myfilter:region`` for the route ``admin/users/list``.
The above code runs ``myfilter1:config`` for the route ``admin``, and ``myfilter1:config``
and ``myfilter2:region`` for the route ``admin/users/list``.

Any other overlapping options passed to the inner `group()` will overwrite their values.
.. note:: The same filter cannot be run multiple times with different arguments.

Any other overlapping options passed to the inner ``group()`` will overwrite their values.

.. note:: Prior to v4.5.0, due to a bug, options passed to the outer ``group()``
are not merged with the inner ``group()`` options.
Expand Down
4 changes: 2 additions & 2 deletions user_guide_src/source/incoming/routing/026.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

$routes->group('admin', ['filter' => 'myfilter:config'], static function ($routes) {
$routes->group('admin', ['filter' => 'myfilter1:config'], static function ($routes) {
$routes->get('/', 'Admin\Admin::index');

$routes->group('users', ['filter' => 'myfilter:region'], static function ($routes) {
$routes->group('users', ['filter' => 'myfilter2:region'], static function ($routes) {
$routes->get('list', 'Admin\Users::list');
});
});