Essential Symfony Bundles

The bundles used by 99% of my projects

Symfony Bundles

There is always a few things most of my websites projects have in common. For example they nearly always require localization. Symfony comes with a translation system, but not a route translator (to get a proper URL for each locale). I searched and tried the most popular route translator bundles and then, I settled on the one I now include in all my projects.

jms/i18n-routing-bundle

This bundle handles route translations, it allows you for example to have an English contact page at: /contact and a French one at: /fr/contacter. My strategy is to code my application all in English and then translate the routes for the other locales, since the original route is already in English, I don’t have to do anything for the English route translation.

jms/security-extra-bundle

This one does a lot of things, but I mainly use it for the security annotations, such as @Secure(roles=”ROLE_ADMIN”), this makes the action available only if the user is authenticated and has the specified role, otherwise a 403 error is given.

knplabs/knp-paginator-bundle

A bundle that handles the pagination for entities returned by Doctrine. It comes with everything you need to customize the pagination, total results, pages. You can even use it to allow your users to sort your table by any column.

a2lix/i18n-doctrine-bundle

Facilitate translatable entities. Allows you to have an entity that have one or multiple fields translations, such as a title field which could have an English and a French version. Using the next bundle you can easily create forms for such entities.

a2lix/translation-form-bundle

This one helps to create forms for translatable entities. In your form type, you call this bundle as a custom field and set the options for all of the translatable fields that you want to include in your form.

google/recaptcha

Just an adaptation of the Google reCAPTCHA for Symfony, it adds a field type that you can use in your forms to add a reCAPTCHA field.

liip/imagine-bundle

This bundle allows to create image filters, for example you upload a large photo to use in your website and you need to have it display on multiple locations, but one of them is a small thumbnail, you can set a filter on it and it will automatically resize the photo and cache it, you only have to maintain the original photo, all other versions are handled by the bundle and can be deleted and recreated on the fly.


That’s about it for my most important bundles, I use many others, but they can vary from project to project. What about you, what are your essential bundles?

Add a Comment

Your email address will not be published. Required fields are marked *