File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed
Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ controller:
8181 // get all attributes, grouped by class name
8282 $allAttributes = $event->getAttributes();
8383
84+ // get all attributes as a flat list (not grouped)
85+ $flatAttributes = $event->getAttributes('*');
86+
8487 // get attributes of a specific class
8588 $cacheAttributes = $event->getAttributes(Cache::class);
8689 }
@@ -201,6 +204,9 @@ on the controller that handled the request:
201204 // get all controller attributes, grouped by class name
202205 $allAttributes = $event->getControllerAttributes();
203206
207+ // get all controller attributes as a flat list (not grouped)
208+ $flatAttributes = $event->getControllerAttributes('*');
209+
204210 // get attributes of a specific class
205211 $cacheAttributes = $event->getControllerAttributes(Cache::class);
206212 }
Original file line number Diff line number Diff line change @@ -271,19 +271,6 @@ You can limit service registration to specific environments as follows:
271271 services :
272272 App\Service\AnotherClass : ~
273273
274- .. code-block :: xml
275-
276- <!-- config/services.xml -->
277- <services >
278- <service id =" App\Service\SomeClass" />
279-
280- <when env =" dev" >
281- <services >
282- <service id =" App\Service\AnotherClass" />
283- </services >
284- </when >
285- </services >
286-
287274 .. code-block :: php
288275
289276 // config/services.php
You can’t perform that action at this time.
0 commit comments