test.ical.ly | getting the web by the balls

Jan/12

10

I just love Symfony Components!

Only recently there seems to be a lot of talk about the components concept behind Symfony. Some people might ask what is Symfony? a library? a collection? a framework?

The answer of course is: yes.

Finally there is a section in the official Symfony documentation dedicated to the components and a series of blog posts by Fabien about how to implement your own framework on top of them (parts 1, 2, 3, 4). Still loads to do but a nice start.

You can always use the Symfony Standard edition as a full stack framework. But if you have some non-standard requirements that apply for every project of yours you can also build your own distribution (by defining your own set of bundles for example) and use that.

You can use Silex if that makes sense. For smaller projects or prototypes I find it very handy.

And you could write plain PHP and only use one of some of the components without the rest of the frameworks.

Most of the time you will probably working with legacy projects and legacy code. You will be unfortunately unable to start from scratch and use your favorite framework and you have to stick with the old code. In this case instead of rewriting you can introduces little doses of Symfony by using the components wherever you see fit.

Put all configuration into a dedicated place and load it via the Yaml component. Wrap the HTTP communication via the HttpFoundation components. Introduce Routing. Whatever it is you have to change in the existing code you will find a lot of opportunity to refactor little bits of it and make use of Symfony components and over time your legacy code will get cleaner and cleaner and easier to understand.

Even Drupal is doing it!

This is where the power of Symfony lies. It’s so damn flexible.

·

3 comments

  • Ronald Wesselink · 10. January 2012 at 19:24

    It seems the more I learn, the more apparent it becomes how little i know. I try to learn Symfony 2 but i love the structure of Symfony 2

    Greets,
    Ronald Wesselink

  • I just love Symfony Components! | PHP | Syngu · 11. January 2012 at 07:43

    [...] Only recently there seems to be a lot of talk about the components concept behind Symfony. Some people might ask what is Symfony? a library? a collection? a framework?    PHP Read the original post on DZone… [...]

  • A week of symfony #263 (9->15 January 2012) « We are php · 21. February 2012 at 17:30

    [...] I just love Symfony Components! [...]

Leave a Reply

<<

>>

Theme Design by devolux.nh2.me