I've become a bit of Symfony2 evangelist and more so having used it and compared it to other frameworks. Also I've used Symfony 2 on a number of projects, having originally come from a codeigniter and symfony 1.4 background. Here are a few of the key reasons I think it's the one to use.
Why Use Symfony2
- Composer - For me the biggest thing to happen in modern php frameworks is the use of composer. This is the main thing I mention to people I'm trying to convert :) them. Composer is in essence a package management tool which once installed, enables you to use and require third party libraries or bundles as symfony calls them. It takes the pain out of what was once a painful experience, of using 3rd party code. It's as easy as typing one composer command to require the package, and what I love is you see the third party package loading in your terminal. The package is automatically installed in your vendors library, and reference made in a composer.json file in the route of the project. Now you can use it in your controllers by simply referencing with the namespace at the top. While composer is not exclusive to Symfony 2, it's use seems to be more intuitive to me. The benefits of using a third party bundle: it reduces development time, the code is already tested and often contributed to by great developers and it's already being used successfully on many other projects.
- Bundles - Symfony2 enables you to separate your code into as many bundles as you want. These are decoupled from each other, meaning they have their own directories and routing and could be removed entirely without affecting the rest of the project. A 'custom registration' or 'ecommerce cart' bundle that you created, for example, could be used on other projects. Also changed without effecting the rest of the project, so the project can be updated in the future. Also it separates large projects into logically and easy to manage segments, which is good especially for many large projects which can quickly become complex.
- Twig - Twig already comes installed on Symfony. It's a front end template system which makes it easier and cleaner to display data from the controller to the view. For instance displaying a name could be as easy as typing {{ name }} and when the page starts to display more and more data, it's much cleaner and easier for designer and you to work with.
- Debugging - The dev environment has in built debugging, which is much more helpful in fixing bugs than other frameworks.
- Unit testing - Symfony comes with PHPunit installed making it easier to test straight away.
- Performance - As a PHP frameworks go, Symfony is faster than many of the older monolithic frameworks, it's claimed it's 4 times faster than Zend 1 for example.
- Wisdom of The Crowds - More and more companies seem to be adopting Symfony 2. When I first went to the 'London Symfony Meetup Group' two or three years ago, there were maybe 10 developers attending, now there are 100 +, with a waiting list. It's good to use something which is supported by many, as you won't have trouble finding a developer to work on your project.
If you're looking for a Symfony2 developer to work on your project in either a team, or as an individual please get in touch.
Email: