@@ -8,18 +8,28 @@ services:
8
8
_defaults :
9
9
# automatically injects dependencies in your services
10
10
autowire : true
11
- # automatically registers your services as commands, form types , etc.
11
+ # automatically registers your services as commands, event subscribers , etc.
12
12
autoconfigure : true
13
13
# this means you cannot fetch services directly from the container via $container->get()
14
14
# if you need to do this, you can override this setting on individual services
15
15
public : false
16
16
17
- # loads services from whatever directories you want (you can add directories!)
17
+ # makes classes in src/AppBundle available to be used as services
18
18
# this creates a service per class whose id is the fully-qualified class name
19
19
AppBundle\ :
20
- resource : ' ../../src/AppBundle/{Command,Form,EventSubscriber,Twig,Security}'
20
+ resource : ' ../../src/AppBundle/*'
21
+ # you can exclude directories or files
22
+ # but if a service is unused, it's removed anyways
23
+ exclude : ' ^(AppBundle\.php|Entity|Repository)'
21
24
25
+ # controllers are imported separately to make sure they're public
26
+ # and have a tag that allows actions to type-hint services
22
27
AppBundle\Controller\ :
23
28
resource : ' ../../src/AppBundle/Controller'
24
29
public : true
25
30
tags : ['controller.service_arguments']
31
+
32
+ # add more services, or override services that need manual wiring
33
+ # AppBundle\Service\ExampleService:
34
+ # arguments:
35
+ # $someArgument: 'some_value'
0 commit comments