Post for the tag: Extension

Creating Bundle Configuration

Iltar wrote an excellent post on what bundles are in Symfony. In this post I will dive a bit deeper into the configuration of a bundle, since most bundles require some configuration to work. Think of the Doctrine bundle that requires you to configure the database connection. Another example is the twig bundle which has a config item to let it know if it is in debug-mode. But how do you write those configs, how do they work, and why should you use them?

In this post I will give an example of what you need to do to create a configuration for your bundle.

What are Bundles in Symfony?

People often refer to bundles as modules or re-usable code for Symfony applications. When a developer has experience with Symfony1 or another framework with the module concept, it might seem logical that this is what a bundle represents in Symfony.

So what is a bundle? When do you need one and what can it do? What's the difference between an AppBundle and a vendor Bundle?

Copyright © 2016