Skip to content

Commit 2a8d8fd

Browse files
Add note on nuances of the 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.
1 parent 7815198 commit 2a8d8fd

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
@@ -1408,7 +1408,7 @@ when importing the routes.
14081408
14091409
# config/routes/attributes.yaml
14101410
controllers:
1411-
resource: '../../src/Controller/'
1411+
resource: '../../src/Controller/**/*'
14121412
type: attribute
14131413
# this is added to the beginning of all imported route URLs
14141414
prefix: '/blog'
@@ -1424,6 +1424,9 @@ when importing the routes.
14241424
14251425
# you can optionally exclude some files/subdirectories when loading attributes
14261426
# (the value must be a string or an array of PHP glob patterns)
1427+
# NOTE: For now, this will onyl work if you are using the string, glob notation for the
1428+
# resource value. The array notation containing `path` & `namespace` will not work,
1429+
# and neither will using a non-glob string like `'../src/Controller'`.
14271430
# exclude: '../../src/Controller/{Debug*Controller.php}'
14281431
14291432
.. code-block:: xml

0 commit comments

Comments
 (0)