Skip to content

Commit 04ccca1

Browse files
committed
minor #20241 [Routing] Add note on nuances of the Routing exclude config option (toby-griffiths)
This PR was submitted for the 7.1 branch but it was squashed and merged into the 6.4 branch instead. Discussion ---------- [Routing] Add note on nuances of the Routing exclude config option As per reported issue symfony/symfony#39588, currently the `exclude` option for attribute routing only works if the `resource` value is a string, and is a glob pattern, so this updates the example to use a glob pattern, and advise of this, current nuance. Commits ------- 08c1484 [Routing] Add note on nuances of the Routing exclude config option
2 parents 4964d30 + 08c1484 commit 04ccca1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

routing.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ when importing the routes.
14391439
14401440
# config/routes/attributes.yaml
14411441
controllers:
1442-
resource: '../../src/Controller/'
1442+
resource: '../../src/Controller/**/*'
14431443
type: attribute
14441444
# this is added to the beginning of all imported route URLs
14451445
prefix: '/blog'
@@ -1455,6 +1455,9 @@ when importing the routes.
14551455
14561456
# you can optionally exclude some files/subdirectories when loading attributes
14571457
# (the value must be a string or an array of PHP glob patterns)
1458+
# NOTE: For now, this will only work if you are using the string, glob notation for the
1459+
# resource value. The array notation containing `path` & `namespace` will not work,
1460+
# and neither will using a non-glob string like `'../src/Controller'`.
14581461
# exclude: '../../src/Controller/{Debug*Controller.php}'
14591462
14601463
.. code-block:: xml

0 commit comments

Comments
 (0)