S
S
SomethingWeird2018-04-23 17:46:54
symfony
SomethingWeird, 2018-04-23 17:46:54

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

1 answer(s)
V
voronkovich, 2018-04-23
@voronkovich

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 question

Ask a Question

731 491 924 answers to any question