PHPMaker 2026 uses Symfony framework. Symfony uses a bundle system to organize and extend your application.
1. What Is a Symfony Bundle
A bundle in Symfony is similar to a plugin in other software — but even better. It is a self-contained package that adds new features or changes how your application works.
Even Symfony's own core features are built as bundles — such as the FrameworkBundle and SecurityBundle. That means everything in Symfony, from routing to templates, uses the same system that you can also use.
Bundles make it easy to:
- Reuse features across projects
- Share your work with others
- Keep your app modular and maintainable
You can also install third-party bundles created by the community to instantly add functionality such as authentication, file uploads, or image management.
2. Why Bundles Matter
Using Symfony — and its bundle system — opens up a world of possibilities. Instead of starting from scratch, you can combine ready-made bundles to build powerful applications quickly and cleanly.
Bundles bring you:
- Flexibility: add or remove features easily
- Extensibility: connect with many libraries and services
- Consistency: all bundles follow Symfony's conventions
- Community power: a wide range of high-quality bundles available
This modular design is what makes Symfony so adaptable — from small websites to enterprise-scale systems.
3. Installing a Bundle (Example: StofDoctrineExtensionsBundle)
Let's look at a practical example. StofDoctrineExtensionsBundle adds useful behaviors to Doctrine entities, such as automatic timestamps.
Install it with Composer:
composer require stof/doctrine-extensions-bundle
This downloads the bundle and makes it available to your project.
4. Bundle Registration
Not every Composer package is a Symfony bundle. A Symfony bundle is a package specifically designed to integrate with the Symfony framework — it provides configuration, services, and sometimes routes that Symfony can automatically load.
To make Symfony aware of which bundles are active, you need to register them. Symfony keeps this list in a single file called config/bundles.php.
Example:
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Twig\Bundle\TwigBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
];
Each entry tells Symfony which bundle to load and in which environments (all, dev, prod, etc.). Once registered, Symfony automatically loads the bundle's services, configuration, and extensions.
5. Configuring the Bundle
Each bundle can define its own configuration options. In the case of StofDoctrineExtensionsBundle, you can define which Doctrine extensions to enable.
Create a file at config/packages/stof_doctrine_extensions.yaml:
stof_doctrine_extensions:
default_locale: en
orm:
default:
timestampable: true
This enables automatic timestamps for your Doctrine entities.
For example, if you add the #[Gedmo\Timestampable] attribute to a field, its value will update automatically when the entity is created or modified.
Note: Some bundles need more than just a configuration file — for example, they may require template directories, route imports, or extra setup files. Symfony uses something called a "recipe" to handle these automatically. I'll cover recipes in the next topic.
After configuration, you can start using the bundle's features in your Doctrine entities right away — no extra code required.
6. Where To Find Bundles
You can discover useful bundles on:
- packagist.org – search "symfony bundle"
- GitHub – third-party bundles
- Symfony UX – official frontend bundles
7. Summary
- Bundles are Symfony's building blocks for adding new features.
- Installing one can instantly extend your app — like StofDoctrineExtensionsBundle for entity enhancements.
- A Symfony bundle integrates directly with the framework, while regular Composer packages do not.
Next up
In the next topic, I'll explore how to add Symfony bundles to PHPMaker project.