Thanks to visit codestin.com
Credit goes to github.com

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

Commit 18fd46a

Browse files
committed
Making *all* services in src/AppBundle available as services
1 parent e44c4b1 commit 18fd46a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

app/config/services.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,22 @@ services:
1414
# if you need to do this, you can override this setting on individual services
1515
public: false
1616

17-
# loads services from whatever directories you want (you can add directories!)
17+
# makes all classes in src/AppBundle available as services
1818
# this creates a service per class whose id is the fully-qualified class name
1919
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)'
2124

25+
# controllers are imported separately to make sure they're public
26+
# and have a tag that allows actions to type-hint services
2227
AppBundle\Controller\:
2328
resource: '../../src/AppBundle/Controller'
2429
public: true
2530
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

Comments
 (0)