Answer the question
In order to leave comments, you need to log in
Where do you declare global functions (heplers) in Symfony 3?
Where in Symfony 3 can I describe functions that will be available throughout the application?
Answer the question
In order to leave comments, you need to log in
That is composer
https://getcomposer.org/doc/04-schema.md#files
I am writing a full answer, as it should be in Symfony. Do not try to port the practices of other frameworks like Yii and Laravel to Symfony, they are different products for different purposes.
In the ideology of Symfony there is no concept of a helper as in Yii, ROR, Laravel. You need to combine frequently used functions in a Service (you can call it whatever you like) according to the nature of the functionality, put it in a DI container and inject it into those classes that need this grouped functionality.
And think about it, if you have such helper classes that are used right and left, then you missed the architectural decision. One class, one duty. Understanding SOLID and practicing will help you reach a different level of object design and development in general.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question