Skip to content

[Routing] Improve the explanation of the exclude parameter #18877

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

Merged
merged 1 commit into from
Sep 19, 2023
Merged
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
9 changes: 6 additions & 3 deletions routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,8 @@ when importing the routes.
# trailing_slash_on_root: false

# you can optionally exclude some files/subdirectories when loading annotations
# exclude: '../../src/Controller/{DebugEmailController}.php'
# (the value must be a string or an array of PHP glob patterns)
# exclude: '../../src/Controller/{Debug*Controller.php}'

.. code-block:: xml

Expand All @@ -1685,12 +1686,13 @@ when importing the routes.
the 'prefix' value is added to the beginning of all imported route URLs
the 'name-prefix' value is added to the beginning of all imported route names
the 'exclude' option defines the files or subdirectories ignored when loading annotations
(the value must be a PHP glob pattern and you can repeat this option any number of times)
-->
<import resource="../../src/Controller/"
type="annotation"
prefix="/blog"
name-prefix="blog_"
exclude="../../src/Controller/{DebugEmailController}.php">
exclude="../../src/Controller/{Debug*Controller.php}">
<!-- these requirements are added to all imported routes -->
<requirement key="_locale">en|es|fr</requirement>
</import>
Expand All @@ -1716,7 +1718,8 @@ when importing the routes.
false,
// the optional fourth argument is used to exclude some files
// or subdirectories when loading annotations
'../../src/Controller/{DebugEmailController}.php'
// (the value must be a string or an array of PHP glob patterns)
'../../src/Controller/{Debug*Controller.php}'
)
// this is added to the beginning of all imported route URLs
->prefix('/blog')
Expand Down