Symfonian way to store custom utilities and helpers in symfony 2

Sometimes there are some functions or procedures that I write as helpers and utilities for use in all my applications ... Now I start using Symfony 2 and I don’t know what is the best way according to the symfony 2 Bundles philosophy ... I I wouldn’t want to create a whole Bundle just for storing, perhaps, several functions, but if this is the best way, I will do it. Thanks!

+6
source share
1 answer

If your utilities and helpers are not specific to Symfony, create the library in a separate repo and install it to the suppliers using deps using the bin/vendors install or through Composer , which will become the standard way to manage suppliers with Symfony 2.1.

If you want your library to integrate seamlessly with Symfony, create the package in another separate repo and install it to the providers. Thus, your library can be used outside of Symfony projects, but when used in Symfony, it provides some convenience.

Also see a few questions.

+8
source

Source: https://habr.com/ru/post/912817/


All Articles