@@ -51,18 +51,17 @@ services:
51
51
# In this example, the classes found in the following directories will be
52
52
# automatically registered as services:
53
53
#
54
+ # * src/AppBundle/EventListener/
54
55
# * src/AppBundle/Form/Type/
55
56
# * src/AppBundle/Security/
56
57
# * src/AppBundle/Twig/
57
58
# * src/AppBundle/Utils/
58
59
#
59
- # Thus, only the classes whose corresponding filename ends with the "Subscriber.php"
60
- # suffix in the src/AppBundle/EventListener/ directory will be registered as
61
- # services in the service container. Other classes of this directory will be simply
62
- # ignored.
60
+ # The "resource" attribute can accept more specific glob patterns like
61
+ # "{EventListener/*Subscriber.php,Form/Type/*Type.php}".
63
62
AppBundle\ :
64
63
# Register all classes in the src/AppBundle directory as services
65
- resource : ' ../../src/AppBundle/{EventListener/*Subscriber.php ,Form/Type,Security,Twig,Utils}'
64
+ resource : ' ../../src/AppBundle/{EventListener,Form/Type,Security,Twig,Utils}'
66
65
67
66
# The other section defines a rule to automatically register and autowire the
68
67
# controller classes found in the src/AppBundle/Controller/ directory.
@@ -116,7 +115,7 @@ services:
116
115
# Those events are defined in the tags added to the service definition.
117
116
# See http://symfony.com/doc/current/event_dispatcher.html#creating-an-event-listener
118
117
AppBundle\EventListener\CommentNotificationListener :
119
- arguments : ['@mailer', '@router', '@translator', ' %app.notifications.email_sender%']
118
+ $sender : ' %app.notifications.email_sender%'
120
119
# The "method" attribute of this tag is optional and defaults to "on + camelCasedEventName"
121
120
# If the event is "comment.created" the method executed by default is "onCommentCreated()".
122
121
tags :
0 commit comments