For about six months we have been using Symfony 2 for developing web projects. We have accumulated a list of useful libraries and bundles that are not part of the
symfony-standard , but significantly save time and save the invention of the bicycle.

The review is more theoretical and includes the following sections:
- Adm generators
- Users
- Xls import / export
- API and OAuth 2.0
- Menu / Navigation
- Multimedia
- Forms
- Search
- Pagination
- File system
- HTTP client
Examples of use and code can be studied on the pages of each project on github.com or on official sites, but if interested, some solutions can be considered separately.
')
Adm generators
SonataAdminBundle
Probably the most functional package for creating a content control panel.
Using together with:
- SonataDoctrineORMAdminBundle / SonataDoctrinePhpcrAdminBundle / SonataDoctrineMongoDBAdminBundle / SonataPropelAdminBundle
- SonataUserBundle
- SonataMediaBundle
- FOSUserBundle
You can organize a tolerable "admin", allowing you to manage:
- By users
- User groups
- Media (images, videos, YouTube, Vimeo, other files)
- User Entities and Entity Relationships
There is:
- dashboard
- login / logout
- menu
- extensible filters for lists
- widgets and handlers for relationships between entities (manyToOne, manyToMany, etc.)
- group operations
- import lists in json, csv, xml, xls
- interface translations

For database abstraction and NoSQL are available: Doctrine, Propel.
Stable running with stable symfony 2.0. *.
We used with 2.0.10.
About SonataAdminBundle was already
post vitiko .
Project siteProject on github.comSandboxAdmingeneratorBundle
A simpler and less functional package for managing your entities, but with a more convenient (subjectively) customization mechanism. The entire configuration is described in generator.yml for each entity.
There is:
- menu
- filters for lists, by field values
- widgets and handlers for relationships between entities (manyToOne, manyToMany, etc.)
I think it deserves attention, although it requires a lot of manual work and how many repetitive actions seemed. For each entity, it was necessary to generate an admin bandle and bundle to display information in the public section.
Project siteProject on github.comSandboxVidos
Users
FOSUserBundle
One of the most popular bundles for symfony 2, which provides extensive functionality for managing users. The package implements the main tasks that arise when working with users:
- Basic user properties: activity, name, login, password, email, date of creation / change / last authorization, etc. Flexible Expandable
- User groups with symfony 2 role binding
- User registration with email confirmation
- Password recovery
- User Profile
- Various forms and handlers
- Various data storage schemes: DB, NoSQL
Used in many other projects for symfony 2.
Project on github.comVideo manualSonataUserBundle
Used to integrate the FOSUserBundle into the SonataAdminBundle, manage users through the administrative interface, and extend the functionality of the FOSUserBundle.
Project on github.comFOSFacebookBundle
This bundle integrates the Facebook PHP / JavaScript SDK's into your project on Symfony 2. In addition, it provides its own authentication provider that allows users to log in to the project through Facebook (button, “Login via Facebook”). At the same time, integration with FOSUserBundle is supported.
You can use Symfony 2-based Canvas App for Facebook, but you will need to write your AuthenticationListener for cross-browser sessions (p3p and blocking iframe cookies from ie7 / 8).
Project on github.com
Xls import / export
PHPExcel
Everyone knows the library to work with xls tables.
It is convenient to use to import data (customers like to provide data in xls) to the database and export to xls (statistics, reports, etc.)
Project site and documentationProject on github.com (unofficial repo)
ExcelBundle
Bundle providing various service containers (DI) for working with PHPExcel. Allows you to quickly create controllers that generate xls as a response (Response).
Project on github.com
API and OAuth 2.0
FOSRestBundle
Bundle with useful tools for creating RESTFul web services.
Opportunities:
- View helper to render the response (Response) in the correct format (json, xml)
- Custom route loader (routes) for generating resource URLs in accordance with the REST concept
- Automatic generation of routes (routes) for web service resources by the name of the controller method (getNewsAction () -> / api / news)
- Exception controller to send the corresponding HTTP statuses
Very useful in the development of the server side of the mobile application.
Project on github.comEscapeWSSEAuthenticationBundle
Bundle allows you to organize simple authentication of requests to your API. Based on extended HTTP authentication. The extension uses open security specification for web services - WSSE. In particular, adapted by HTTP Authentication, the WSSE Username Token algorithm, borrowed from SOAP.
Also useful in the development of the server side of the mobile application.
Atom AuthenticationProject on github.comInformation on symfony.comOAuth2-php
OAuth 2.0 server in PHP. Currently implemented OAuth 2.0 draft 20.
Google Code ProjectProject on github.com (fork)
FOSOAuthServerBundle
Bundle integrates OAuth2-PHP features into a symfony 2 project.
It is useful for projects wishing to implement access and authorization to their own API via OAuth 2.0 protocol.
In real projects I did not use it, but when testing it seemed that it was well implemented (If someone has experience in combat, write in the comments).
Project on github.com
Menu / Navigation
Knpmenu
A library that provides an object-oriented interface for creating navigation on your site.
Project on github.comKnpMenuBundle
Also one of the most popular symfony 2 bundles that integrates the KnpMenu library into your project and provides various tools for flexible navigation management (menu) of the site:
- Object-oriented interface for creating menus of various nesting and complexity, including on the basis of data from the database
- Rendering menus according to custom templates
- Twig features
- Highlight active items and various customization tools
Used in all projects.
Project on github.com
Multimedia
Imagine
Library for working with images in the usual object-oriented style. Depending on the selected image, you may need:
Opportunities:
- Resizing, cropping images
- Drawing API, for creating images and drawing text on the image
- Mask functionality for working with image transparency
- Creating various filters based on the above features
Very handy library for creating thumbnails, but this is only a small part of all the possibilities.
The author was inspired by the PIL library in Python.
Project site and APIProject on github.comAvalancheImagineBundle
A bundle for simple image manipulation in your symfony 2 project.
Allows you to customize various filters for displaying images from your collection.
Filter Settings:
- Thumbnail size
- Compression ratio
- Resize / image cropping method (outbound / inset)
- Image processing driver (gd, imagick, gmagick)
- and other
There are Twig tags (functions) to display the corresponding image with the selected filter. Also in the bundle implemented custom route loader. When accessing a specific controller, it (the controller) generates an image and gives it as a server response.
I used this bundle to dynamically generate thumbnails:
- Original images are uploaded to the site's gallery.
- The required filters are configured.
- The views display the paths to the images that correspond to the settings of the bundle and filters (using twig functions)
- When a client calls the server for an image, we force apache / nginx to check the actual existence of the image.
- If the picture exists, the server gives it as static.
- If not, it does rewrite / redirect to the corresponding controller, after which the image is created and subsequently given statically
I had to really create my own Twig extension, with the function that generates the path to the picture, taking into account the specified filter, bundle settings and its requirements.
Conveniently! Alternatively, you can use for the server part of mobile applications, when changing the design of the concept, it will be enough to describe the new filter.
Project on github.comSonataMediaBundle
A media library that allows you to manage (load, delete, organize into galleries) various media (files, videos, images) in your Symfony 2 + SonataAdminBundle project.
Each type is managed by its own service provider, which is responsible for:
- Extracting media file metadata
- Creating thumbnail images
- Editing form settings
- Rendering and presentation of media files in templates
Media files can be context related. Context allows you to group sets of media, for example: news - news context, users - user context. Since the requirements for media files can be different for each context, the context determines the filters (configured in the config) that will be used to change the media.
Filter Settings:
- Thumbnail size
- Compression ratio
- Resize / image cropping method (outbound / inset)
- Other
The package provides the ability to implement its own logic of resizing and framing for its filters, as well as an alternative to
LiipImagineBundle (fork AvalancheImagineBundle).

Available services:
- Providers:
- sonata.media.provider.image: Image
- sonata.media.provider.file: File
- sonata.media.provider.dailymotion: Dailymotion
- sonata.media.provider.vimeo: Vimeo
- sonata.media.provider.youtube: Youtube
- File systems:
- sonata.media.filesystem.local: Local file system (default)
- sonata.media.filesystem.ftp: FTP
- sonata.media.filesystem.s3: Amazon S3
- Various CDN
In general, a powerful package, but there are a number of small jambs, which have to be fixed when using. For example, displaying a preview of a picture when editing an entity using media binding.
Project siteProject on github.com
Forms
GenemuFormBundle
Bundle extending the functionality of the Symfony 2 Form Component, using jQuery, jQuery UI and various plug-ins.
Some forms and widgets that the bundle provides:
It is unlikely that you will need to use all the features in one project, but tweaking some implementations will be useful and can save time.
Project on github.comCaptchaBundle
Bundle adds captcha support for the symfony 2 Form Component.
It contains a basic set of settings, but if you wish, you can add / change the required functionality:
- Background color
- Text color
- Font
- Font size
- Distortions
I really needed to be very fast, so I had to fix the bundle, but next time I’ll do PR, honestly)))
Project on github.com
Search
SphinxBundle
I think you should not tell what Sphinx is, everyone should know. So SphinxBundle is a bundle that allows you to work with Sphinx search indexes. To work, you need a library sphinxapi.php from the
official site .
In the index, according to the table of the entity (Entity on which the search is performed), there must be an identifier (id) of each entity. After a request to the search daemon, by identifiers (id) of the found records, the entities themselves that are relevant to the search query are obtained from the database, with the possibility of page-by-page navigation.
Although the bundle doesn’t provide so many opportunities, it helped me a lot as a base for realizing my tasks. For example, I had to implement my own logic for working with several entities (the sphinx index, also has to be built on several tables of entities), so that later in the view (View) for each entity use personal “search snippets” (text blocks that differ for each entities) and routes (route) for generating links, because entities presented in different sections of the site.
Project on github.com
Pagination
Pagerfanta
Library for "pagination" of data sets in PHP 5.3.
Uses different adapter classes, depending on the types of data that need to be paginated:
- ArrayAdapter
- MongoAdapter
- MandangoAdapter
- DoctrineORMAdapter
- DoctrineODMMongoDBAdapter
- DoctrineCollectionAdapter
- Propeladapter
- SolariumAdapter
It is possible to control (View) a pager, several ready-made options, as well as the possibility of versatile customization.
Project on githubWhiteOctoberPagerfantaBundle
A bundle that allows you to quickly and easily integrate the Pagerfanta library into your project on Symfony 2. And also use additional features such as: Twig functions, custom templates, and others.
Used in almost all projects. There was a problem with the DoctrineORMAdapter when paginating the Doctrine \ ORM \ NativeQuery object, but still a solution was found and for custom queries built using NativeQuery a custom adapter was written. Now it seems to be fixed, but only for Doctrine ORM 2.2 (if I understood this
commit correctly)
Project on github.com
File system
Gaufrette
A library that provides a level of file system abstraction, and allows you to develop applications that involve the use of a large number of media files, without thinking about where and how they will be stored.
Using abstraction in this case gives you the opportunity to change the storage location of your files, without much intervention in the code. Suppose your project has become popular, and there is a problem with file space, you can simply change the used file system from local to Amazon S3 file hosting and scale your media data further without any problems. And to speed up the work of slow file systems (Amazon S3, FTP), a local caching mechanism is provided.
This library provides a file system abstraction layer for SonataMediaBundle.
It was possible to use only with the local file system, it is interesting to hear the comments of those who used with FTP or Amazon S3.
Project on github.com
HTTP client
Buzz
HTTP client on PHP5.3. Allows you to send HTTP requests (using FileGetContents, Curl, MultiCurl), receive responses, work with cookies, HTTP headers, send forms, work with the history of requests and more.
I think there is a use)
Project on github.comSensioBuzzBundle
Bundle integrates the Buzz library into your project on Symfony 2 as a container service (DI).
Project on github.com
Fuuuh!
While all ...
And yes, it is convenient to use
knpbundles.com to search for bundles
.