File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1439,7 +1439,7 @@ when importing the routes.
1439
1439
1440
1440
# config/routes/attributes.yaml
1441
1441
controllers :
1442
- resource : ' ../../src/Controller/**/* '
1442
+ resource : ' ../../src/Controller/'
1443
1443
type : attribute
1444
1444
# this is added to the beginning of all imported route URLs
1445
1445
prefix : ' /blog'
@@ -1455,9 +1455,6 @@ when importing the routes.
1455
1455
1456
1456
# you can optionally exclude some files/subdirectories when loading attributes
1457
1457
# (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'`.
1461
1458
# exclude: '../../src/Controller/{Debug*Controller.php}'
1462
1459
1463
1460
.. code-block :: xml
@@ -1523,6 +1520,12 @@ when importing the routes.
1523
1520
;
1524
1521
};
1525
1522
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
+
1526
1529
In this example, the route of the ``index() `` action will be called ``blog_index ``
1527
1530
and its URL will be ``/blog/{_locale} ``. The route of the ``show() `` action will be called
1528
1531
``blog_show `` and its URL will be ``/blog/{_locale}/posts/{slug} ``. Both routes
You can’t perform that action at this time.
0 commit comments