Tom
Tom

Reputation: 1223

Symfony 4 how to use my own Bundle

I have my own Admin Bundle which is being developed in time. I just put it into new project and use it. If I need a new functionality I add it and use it later in another project. I put it in src/ directory. I don't want to store in on public Git repository.

Now as Symfony 4 is bundle-less, how should I easly put it into src/ dir so that it is decoupled from other App code?

I would like to develop the App as I shoulg but I would like to have an opportunity to easly copy Admin code to use it for another project.

Upvotes: 0

Views: 563

Answers (1)

Alister Bulman
Alister Bulman

Reputation: 35139

Bundles are still perfectly available and useful in Symfony 4. They aren't suggested to be used for the main program code, as it is a little easier to not need that structure.

3rd party bundles are still incredibly useful though, to easily connect functionality, templates and services to an application. Equally, if you have some code that can be used in multiple applications and most easily added as a bundle, you are perfectly able to write your code as its own bundle. You can initially write it within your src/ directory, and then migrate it out to be an external bundle/library that can be pulled in via Composer when it's useful to do so.

Upvotes: 1

Related Questions