Clint Berry

Full-stack Web Developer

Wannabe Entrepreneur

Why I Switched to Symfony 2 Framework

Posted on 10 Nov 2011 in PHP, Symfony | 3 comments

I have been working with the Zend Framework for the last 3 years. I like it. It is flexible, heavily object oriented, and organized. However, one thing that has always bothered me is that modules in ZF have been second-class citizens. Granted, in Zend Framework 2 this is not the case, but I needed to start a project right away, and since ZF2 is still in beta, I decided to go checkout some other frameworks again.

It has been a while since I looked at different PHP frameworks and I was plesently surprised by the maturity of many of them. Ultimately, though, I was most impressed with Symfony 2 (SF2). Here are some reasons why:

1. Modules (Bundles)

I am a sucker for modules. For some reason I like the idea of being able to create a small library of code, with all the corresponding models/views/controllers, and then being able to drop it any application and have it work (some say I should switch to Python, which inherently works this way). It would mean all sorts of portability for my code. Symfony2 has this ability in the form of Bundles. I started using them this week, and I fell in love. Did I mention there is already a big library of bundles that you can drop in your application? This is the future of PHP development.

2. Defining Routing Using Annotations

Symfony2 allows you to add Annotations (doc blocks) to controller actions that tell the application when to route to this action. You can put any regular expression pattern to match the URL. For some reason this seems so much more elegant than creating a separate routing file.

3. Community

Some of my favorite developers are big contributors to the symfony project. Also, it is the number 1 watched PHP project on GitHub. That is saying something.

4. Documentation & Learning Curve

Zend Framework has a pretty steep learning curve and the documentation does not support beginners very well (although I know they want to remedy this for ZF2).Symfony, however, has a great getting started guide and a great online book to help you get going. It has been so easy to get started that it was hard not to smile.
 

It has only been a week, but I am loving Symfony2. I keep running into new things that make me love SF2 more and more. I’m sure the honeymoon won’t last forever, though, so I’ll of course be posting more on this as I run into issues, find out the negatives, and have more comments in general. Let me know if you like Symfony or prefer something else.

Update: I found another great link that is helpful if you are looking to use Symfony2 for your next projectHow OpenSky chose Symfony as their framework

 

I am a full-stack web developer that is passionate about start-ups.

3 comments

  1. kurt krueckeberg / February 29th, 2012 19:29

    I really appreciate your comments as they summarize my feelings about ZF. I agree the ZF documentation is not geared for beginners. The symfony document seems much more user-friendly. Bundles do sound like a great convenience for code reuse.

  2. Kevin / September 11th, 2012 21:33

    I’ve been using Symfony since version .6. I never looked back.

  3. Suraj Kumar Adhikari / September 16th, 2012 10:29

    Im using Symfony2 and its awesome…………….. a great framework!!!!!!!!!!!!!!!!!!!!!!!!!!1

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>