This course is still being released! Check back later for more chapters.
Symfony Bundle Development: Share the Love
Go from empty folder to polished Symfony bundle — complete with services, config, testing, CI, and a Flex recipe — and learn how to share your code with the world.
About this course
Ever wondered how those Symfony bundles you install with Composer actually get made? In this course, you’ll build one from scratch and see how all the pieces fit together. From the first composer init to wiring services, adding entities, and creating config options, you’ll get the full behind-the-scenes tour of bundle development.
You’ll learn how to:
- Set up a modern Symfony 6.1+ bundle structure
- Design your code with backwards compatibility in mind so your bundle can evolve without breaking users
- Wire services, entities, and configuration the bundle way
- Add a Twig extension
- Create console commands
- Write tests to keep your bundle solid
- Keep code style consistent with PHP-CS-Fixer
- Configure and run static code analysis with PHPStan
- Push it to GitHub and set up GitHub Actions to tests across different PHP and Symfony versions
- Create a Symfony Flex recipe so installation feels like magic
By the end, you’ll know how to package your own code into a polished, reusable bundle that’s ready to share - whether with your team, your future self, or the entire Symfony community.
Next courses in the Symfony 7: Go Further section of the Symfony 7 Track!
8 Comments
Hey @seb-jean!
To add to Victor's comment, the current recommendation is to use md instead of rst. Rst isn't render too well on GitHub. I also like to keeps documentation in the readme until a time the docs get too big. Then I switch to the docs folder.
--Kevin
Hey @seb-jean,
Yes, we will mention the docs in this course. Actually, you may want to add docs to your bundle as soon as you can as it will help your users a lot. On practice, libs/bundles without docs (or with bad/poor docs) people just avoid as it's getting tricky to implement that in their projects. So, definitely add some docs on the early stage when you think your bundle is ready for real user projects. Basically, you want to explain how to install, configure, and use your bundle. You can take as an example your favorite bundle docs. The best would be to stick to Markdown format I think - simple and easy to start, Symfony uses .rst format internally for a reason.
I hope this helps!
Cheers!
I was checking in on SymfonyCasts, wondering when you guys and girls would tackle translating database content and wondering why you had not started that...
Then I found this, absolutely genious idea! Now I have to hurry up with the translating course.
Thanks for this!
Hey Odds,
Thanks for your feedback! We're super happy to hear you loved this idea :)
Cheers!
Will there be a section concerning documentation? For example, for the README.md and docs/index.rst files.