Even after reading best practices for code reuse in symfony and search for the use of < a href="https://tableless.com.br/composer-para-iniciantes/"> composer , I still can not understand how in practice I should create my bundle to be reusable. I know that the way I do is not ideal and I wanted to do it right, but I'm having a hard time understanding how I should do it.
Today I do the following:
composer create-project symfony/framework-standard-edition projects/symfony2 "2.8.*"
app/console generate:bundle --namespace=Vendor\Bundle\MeuModuloBundle --format=annotation
composer update
Working in my Bundle's business rules (Vendor \ Bundle \ MyModuloBundle)
Comito and my bundle is ready.
If I need to reuse the bundle I add its name in the composer (as I have described in the Vendor \ Bundle \ MyModuloBundle composer.json and run the composer update command. p> The problem in all this is that the code goes full of garbage, with the app, src folder, the conflict with the appKernel and etc ... because in reality it is a treats like a project (because I did so in the way I want to actually reuse it as a module, but I do not know how to do it right, because I need to create a module but I want to be able to use doctrine, route, fosrest and other features that are already ready in symfony.
How should I proceed to do it right?
Good practice shows the structure of folders that must be created for the project to be compatible with symfony One of my doubts is how I would create a clean project, for example: I would have to create a default structure and not to use the symfony model? where I would put the configuration files config.yml, parameter.yml, AppKernel, how would composer.json, autoload, app.php, app_dev.php, console and etc ... used today, or would it be replaced by what ? that is the question itself.