Skip to content

Commit 99427cb

Browse files
committed
Reword
1 parent 04ccca1 commit 99427cb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

routing.rst

Lines changed: 7 additions & 4 deletions
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,9 +1455,6 @@ 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'`.
14611458
# exclude: '../../src/Controller/{Debug*Controller.php}'
14621459
14631460
.. code-block:: xml
@@ -1523,6 +1520,12 @@ when importing the routes.
15231520
;
15241521
};
15251522
1523+
.. caution::
1524+
1525+
The ``exclude`` option only works when the ``resource`` value is a glob string.
1526+
If you use a regular string (e.g. ``'../src/Controller'``) the ``exclude``
1527+
value will be ignored.
1528+
15261529
In this example, the route of the ``index()`` action will be called ``blog_index``
15271530
and its URL will be ``/blog/{_locale}``. The route of the ``show()`` action will be called
15281531
``blog_show`` and its URL will be ``/blog/{_locale}/posts/{slug}``. Both routes

0 commit comments

Comments
 (0)