Secrets of Symfony

“Symfony2 is a PHP framework, a philosophy and community”

In this month’s Web Designer magazine, our very own Richard Miller discusses the revolution of Symfony2. For anyone who didn’t manage to grab a copy of the magazine (our local paper shop sold out), below is a copy of the article, as featured in issue 203.

Is it time to realize the potential of the PHP framework Symfony2?

Symfony2. Never heard of it? Well now is the time to take a closer look at this PHP web development framework and get ahead of the rest. Joining the Symfony2 revolution is just the beginning. Getting yourself certified will immediately make you a member of a very exclusive club. If you joined today you’d be one of three. It doesn’t get much more exclusive than that. But Symfony2 is not about exclusivity, it’s about community – and the more members that join the small band of certified developers the better.

Now that you have been tempted with a little prelude, let’s get to the crux of the matter.

What is Symfony2 and why should you care?

Symfony2 is a PHP web development framework, a philosophy and community – all working together in harmony. It is the development of the original Symfony framework, but harder, better, faster and stronger. For me, the most exciting thing about Symfony is that as well as offering a full stack framework, it is also a collection of standalone components that can be used on their own outside the framework. The frameowrk is, in a sense, a pick ‘n’ mix of components that can be used as part of smaller projects, introducing them as a way of refactoring legacy code, and can even be incorporated as part of other frameworks. Symfony components are already being used in librairies such as Doctrine 2 (an Object Relational Mapper for database abstraction) as well as phpBB4, the PPI Framework, and eZ Publish.

To demonstrate its growth, Drupal developers are also incorporating Symfony2 components into Drupal 8, a step that has the web community debating what Symfony2 can bring to the table. Drupal developers have always prided themselves on innovation and are constantly looking for new ways to improve their model. Developers who have previously shied away from using Drupal will be encouraged by the inclusion of Symfony components to further push innovation and improve code quality. Nevertheless, Drupal is growing fast, and with demand for it ever increasing, adopting Symfony’s many reusable components has enabled them to enhance their own strong architecture with another.

Symfony2 can be seen as a beautiful new creation of all the best parts of existing frameworks. It draws on experiences from the first version of Symfony and other PHP frameworks, but also looks outside of PHP to draw inspiration from the best practices, libraries and frameworks of other languages – Java, Python, etc. Symfony2 focuses on best practices and writing clean, readable and testable (and well tested) code. The use of dependency injection along with the service container and event dispatcher make for flexible code which you can build on to ensure your application has high standards of code quality.

Open source enthusiasts will be pleased to know that Symfony2 favours configuration over convention so it can be reconfigured to suit the needs of your project. This means you are not fighting against the framework when you need to do something beyond typical web needs. However, don’t worry that you will need to configure everything as the default configurations are perfectly fine in many cases. And, in the interests of freedom and happiness in the open source community, Symfony2 is not in competition with any other frameworks as it can be incorporated into any other framework to develop and enhance it.

Like many other open source projects around the world, Symfony2 already has a strong community behind it providing all the support budding Symfony developers need to get involved. The community is constantly developing new features and are willing to offer support and advice whether it is via Twitter, mailing lists and forums, or meet-ups and conferences. If you now think that with all its wonderful features and notions of freedom it is a darned shame that there are only two certified developers out there, fret no more. In September, developers in the UK had their first chance to sit the exam to be certified in the framework – it’s easy to join the Symfony2 revolution. The first exam took place at the Symfony Live conference, open to all Symfony enthusiasts around the country, but that was just the starting point of the development of Symfony2 becoming the go-to framework for PHP developers. See for upcoming events.

Courtesy of Web Designer