8000 Mentioned the short syntax for XML config of service factories · symfony/symfony-docs@eafe44a · GitHub
[go: up one dir, main page]

Skip to content

Commit eafe44a

Browse files
committed
Mentioned the short syntax for XML config of service factories
1 parent ec0865f commit eafe44a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

service_container/factories.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ configure the service container to use the
5757
<service 8000 id="AppBundle\Email\NewsletterManager">
5858
<!-- call the static method -->
5959
<factory class="AppBundle\Email\NewsletterManagerStaticFactory" method="createNewsletterManager" />
60+
61+
<!-- starting from Symfony 3.3, if the factory class is the same as the service
62+
class, you can omit the 'class' attribute and define just the 'method' attribute:
63+
64+
<factory method="createNewsletterManager" />
65+
-->
6066
</service>
6167
</services>
6268
</container>

0 commit comments

Comments
 (0)
0