I try to attach a file via Swiftmail to my Email in Symfony: $message = (new Swift_Message($message)) ->setFrom([$smtpMail => $smtpName]) ->setTo($smtpMail) ->setBody($…
Tag: service
Symfony: Service in other Service not loaded (Too few arguments)
Background I have a OptionHelper-Class that is looking in the database-table, where I store some flexible parameters. This class is working fine in Controllers. Now I want to use this class in a …
Instantiate new class instance inside Symfony services (Best practice)
In Symfony when I create a service and I need an instance of some classes, I pass them as parameter in service or I can create a new instance inside my functions service. I ask this because some Classes constructor needs parameters which I don’t have yet when passing the class as parameter. Answer you pass them as params in