Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit d474a60

Browse files
committed
added documentation for route config array-key as name
1 parent 007c678 commit d474a60

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/book/v3/cookbook/autowiring-routes-and-pipelines.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ return [
4040
'the' => 'underlying router',
4141
],
4242
],
43+
'another.route.name' => [
44+
'path' => '/another/path/to/match',
45+
'middleware' => 'Middleware service or pipeline',
46+
'allowed_methods' => ['GET', 'POST'],
47+
'options' => [
48+
'more' => 'router',
49+
'options' => 'here',
50+
],
51+
],
4352
],
4453
];
4554
```
@@ -97,7 +106,9 @@ following keys:
97106
the HTTP methods allowed for the route. If this is omitted, the assumption is
98107
any method is allowed.
99108
- `name` (optional, string): the name of the route, if any; this can be used
100-
later to generate a URI based on the route, and must be unique.
109+
later to generate a URI based on the route, and must be unique. The name may
110+
also be set using a string key in the routes configuration array. If both are
111+
set the name assigned in the spec will be used.
101112
- `options` (optional, array): any options to provide to the generated route.
102113
These might be default values or constraints, depending on the router
103114
implementation.

0 commit comments

Comments
 (0)