Symfony World blog is not maintained anymore. Check new sys.exit() programming blog.

Symfony framework instead of a well-known CMS

Scene from "All Friends Here" aka "Our Folks" aka "Sami Swoi" by Sylwester Chęciński (1967)

Recently I got involved in developing and deploying a small website promoting a book that has just been released. My coordinator asked me to choose one of the most popular Content Management Systems (Wordpress, Joomla, Drupal) to deploy the site on. Since I have a very little experience with developing apps based on a full-featured CMS, I was not so happy to be forced to learn a CMS just for a single small project.


I was given a full, well-prepared layout. The first step was to replace the default layout with the one I have just received. I took a look at Wordpress (because it seems to be the easiest and the smallest CMS). A glance at the template files has given me an overview stating that I will really need to spend some time to fully understand the wordpress templating system. Of course, it doesn't mean that it's difficult or out of my reach - I'm just lazy, as most of us :) - and I prefer designing complex and complicated systems rather than studying boring wordpress engine...


I got an idea of giving up wordpress (after 20 minutes of reading documentation)... At first, it sounded quite crazy - to develop a small site with such a powerful tool like symfony. I asked myself questions like 'do I really need such an advanced tool to develop such a trivial project?' or 'how long is it going to take me to implement all mechanisms that are already implemented in wordpress (such as nice looking menu, panels, intuitive interface and so on)?' Maybe long... but the more I was analysing the time difference between designing the app in an unknown CMS and very well-known symfony framework, the more the symfony option was attractive.


Developing the frontend is only putting the new layout on. Backend is more complex. But still it's all very easy and extremely fast to use. Using sfAdminDashPlugin, sfJqueryReloadedPlugin and sfDoctrineGuardPlugin, the greatest 3 symfony plugins, gave me the basis of a backend engine with many features ready to be improved (e.g. I could define user credentials, I could organise the backend menu, etc). I use these 3 plugins in 99% of my projects (and suppose more people do so) and it takes me very little time to configure those plugins.


Developing backend is mainly working with generator.yml/module interface configuration, because this part is usually different in all web apps (meaning that you can copy lots of model/form/filter methods from your previous projects, to save time). If you implement any feature and use it in any project, you can always copy it later to another project (or make yourself a plugin, which is usually a better choice, because the whole community may reuse your work). Just like my AJAX backend activate/deactivate feature (see easy symfony ajax user friendly example) - after I managed to implement the feature (which originally could have taken me up to 3 hours, including studying entire symfony AJAX, ajax routing, sfJqueryReloaded and so on), now it takes me less than 5 minutes to copy it to a new place. Or to make a similar feature somewhere else. And imagine that some mechanisms, like taggable or commentable behavior can be put into plugins, which makes it even faster to use! This is one of the biggest symfony advantages - the speed on development. All of us shall use it as much as we can.


Choosing symfony for this project was a great decision. It saved me a lot of time, made me proud of how fast a small symfony project can be developed. Still, the code is comprehensible, it's kept well-documented (so the entire project is opened for any modifications). My experience I want to share with you is that symfony is a good choice also for small projects.

8 comments:

  1. did you use diem, sympal or apostrophe plugins for the cms part?

    ReplyDelete
  2. No. It is just few subpages with dynamic content, a guestbook and a gallery.

    ReplyDelete
  3. For small sites Wordpress is the best choice. WP templating system isn't too friendly, but in return you get a good-looking backend and dozens of easy to implement plugins. I used it a few times already and it saved me a lot of time. I wouldn't use Symfony because when doing small websites I don't want to worry about the insides or play with the code. Using WP I can focus on the visual side of the work.

    For bigger projects Diem is the way to go.

    ReplyDelete
  4. Thank you for the discussion! As I wrote, I was given a full, well-prepared layout, so there's no need for me to focus on the layout.

    It's true that using a CMS gives you many more features. But if you're given a list of functionalities (and the webpage is really simple) symfony is a better (faster) choice for an experienced symfony developer. At least in this case. It all depends on the project size.

    ReplyDelete
  5. I hear you, spending as much time I we do with symfony even a small website is easier with it than WP.

    ReplyDelete
  6. Well, if you used WP you would spend like 2 hours on the layout, and another hour on finding gallery and guestbook plugins and installing them. No db designing, no coding, no reinventing a wheel. I don't think it can be any faster but if you prefer Symfony and you feel more comfortable with it - it's ok with me :) I'm just damn too lazy. Using Sf for anything smaller than a portal I feel like shooting a fly with an RPG ;) But it's just me.

    ReplyDelete
  7. provided that you are already familiar with any CMS package :-)

    ReplyDelete
  8. I just prefer to use symfony. It's my code, it's THE framework, it's my customization, and almost everything I got asked to do It's already done, everything else is a contribution for my libraries.

    ReplyDelete