so i want to put something together with quite a few sections. A lot of these sections will have comments.
If i build these all as modules, do they all need comments built within the module, or will they all be able to work with a separate comment module?
so i’ll have a page with lets say business listings, on the profile page it’ll have comments at the bottom, the same with maybe a movie section.
I beleave you can use a separate comments module, or if it is not that big you can just create a component with a controller and a few views that you can reference in your modules.
You could create a comments portlet, and a commentable behavior which you can use in your models.
That’s probably the best approach.
YiiExt has a Commentable behavior:
It’s not stable (no official download), and I haven’t tried it, but you can check it out.
The comments on each section would work the same so thats why I would prefer to just have them in one general place then I can add a DB column so you know what section they belong to.
the portlet looks more like a widget that you can use to display comments
on the page i was reading one of the portlets to be built was "recent comments"
I need something that will not only display comments but also allow users to post comments
Well… a widget that :shows the comments AND a form to create a new one? (both in the widget ofcourse, sorry for my english, edited this post like 5 times so it would be clear, but I gave up and added this note )
Yeah, in the detail view of a listing you can see comments and there’s a form to post a comment, but this would be shared between different sections.
Cause if I had to code the same exact thing for each section, well that just seems to go against the point of OOP
I don’t understand the problem? you wont be rewriting anything, you’d be reusing the widget in your sections and the behaviour in your models.
yes that’s what i want to avoid, so I’m going to try to do it as a widget, i’ll let you know if i’m successful.