如何将其转换为yml
:
<service id="fos_user.mailer.twig_swift" class="FOS\UserBundle\Mailer\TwigSwiftMailer" public="false">
<argument type="service" id="mailer" />
<argument type="service" id="router" />
<argument type="service" id="twig" />
<argument type="collection">
<argument key="template" type="collection">
<argument key="confirmation">%fos_user.registration.confirmation.template%</argument>
<argument key="resetting">%fos_user.resetting.email.template%</argument>
</argument>
<argument key="from_email" type="collection">
<argument key="confirmation">%fos_user.registration.confirmation.from_email%</argument>
<argument key="resetting">%fos_user.resetting.email.from_email%</argument>
</argument>
</argument>
</service>
现在我在转换方面做得很远:
fos_user.mailer.twig_swiftr:
class: FOS\UserBundle\Mailer\TwigSwiftMailer
arguments: ['@mailer', '@router', '@twig']
这<argument type = "collection">
是我坚持的路线。感谢。
答案 0 :(得分:6)
尝试:
fos_user.mailer.twig_swiftr:
class: FOS\UserBundle\Mailer\TwigSwiftMailer
arguments:
- @mailer
- @router
- @twig
- { template: { confirmation: %fos_user.registration.confirmation.template%, resetting: %fos_user.resetting.email.template% }, from_email: { confirmation: %fos_user.registration.confirmation.from_email%, resetting: %fos_user.resetting.email.from_email% } }
请检查:http://symfony.com/doc/current/components/yaml/yaml_format.html#collections
答案 1 :(得分:5)