Commit 302939e
committed
feature #62302 [Routing] Simplify importing routes defined on controller services (nicolas-grekas)
This PR was merged into the 7.4 branch.
Discussion
----------
[Routing] Simplify importing routes defined on controller services
| Q | A
| ------------- | ---
| Branch? | 7.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Issues | -
| License | MIT
Fine-tuning #61492
Before:
```yaml
controllers:
resource: attributes
type: tagged_services
```
After:
```yaml
controllers:
resource: routing.controllers
```
And when using `MicroKernelTrait` (the default recipe), there's nothing to configure to have routes loaded from `#[Route]` attributes:
```yaml
#config/routes.yaml
# the file can be just empty from any config, and only have a comment saying what it's for
```
```php
// config/routes.php
return Routes::config([
]);
```
The way to opt-out from this `routing.controllers` import would be to override the `Kernel::configureRoutes()` method.
Commits
-------
13e25caae7d [Routing] Simplify importing routes defined on controller services2 files changed
+3
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | | - | |
| 190 | + | |
192 | 191 | | |
193 | 192 | | |
194 | 193 | | |
| |||
0 commit comments