Recent Comments plugin – against MVC?

April 18, 2007

The Habari project is supposed to follow the MVC model of design. I have yet to fully understand it in plain English.

Owen was of the opinion that I shouldn’t have to do a plugin for ‘Recent Comments’ as a theme designer could easily display ‘recent comments’ using the MVC design feature built into Habari. The Wiki tells you how.

Owen is right of course, if I understood him correctly, but using a plugin makes thing clean, tidy and flexible, e.g. I need only one line to get what I want

RecentComments::comments('5','-4','10')

First parameter 5 is to show 5 comments, second ‘-4′ is time zone difference in hours and last parameter ’10’ is to truncate comment string to 10 words.

Now I have removed my first plugin and moved the class to theme.php. I prefer using just one line to display Recent Comments instead of following the example in the Wiki.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: