Symfony: discovering Propel behavior

Learning Symfony is a kind of never ending story, well, at least for me! I took some time to better understand the benefit of propel behavior plugins and I am simply amazed how it can again simplify and speed up your application coding adding typical features such as:

  • Comments to a type of object (usually articles or news)
  • Tags (aren’t we in the web 2.0 trend?!)
  • Slugs: a strange word to simply give an automatic and still comprehensible and meaningful url
  • Rates, you want a simple way for your users to rates articles or whatever with some nice stars like you can see on many websites? Here you go!
  • Version control: wanna build a wiki or a document management system within your app?
  • sfGuardAuthored a behavior that logs automatically the user modifying any object

…and these are only a few of them. You can find more, some more database related or architecture oriented but all of them are typical things that you will face soon or later in one of your project. Why the hell should you re-invent the wheel?.
Behavior are a kind of pattern or action that you can attach to any of your specific Propel objects in your application. Let’s say you have a Article table/class, then you can give more features to your Articles adding to it some of those behaviors – for example, you can add to your articles these additional features: comments, tags and rating in a couple of minutes. There is almost nothing to code, except your specific integration in your view and controller, but you do not need to code anything about how to manage those behavior.

Once again a good argument to discover and switch to Symfony! Congrats to all the guys behind those plugins (not forgetting those from Propel project itself).

This entry was posted in Symfony. Bookmark the permalink.

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>