Answer the question
In order to leave comments, you need to log in
Symfony 3.4 How to override service from vendor?
How to override the first.php class in the main bundle, which is located in the vendor section of the framework? I can't touch the vendor files and I need to override the function that is in this class. I could not get along with the documentation on this issue. I ask for advice
Answer the question
In order to leave comments, you need to log in
Use decoration: https://symfony.com/doc/current/service_container/...
UPD: Reread the question. You just need to create your own class and inherit from first.php. And change the method in it. And only then register it as a service.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question