Here's a function you could try in your Post model ->
http://bin.cakephp.org/view/607120740
I've given it a default of 5 tags if called with no params. Obviously
you can change this to suit or override it when you call it from your
controller.
e.g. $this->Post->postCountByTagCount(2) will return a count of how
many posts in your DB have more than two tags.
If your Post model has any associations other than the Tag HABTM,
unbind them inside the method.
There's probably a much cleverer way to achieve this, but hopefully
this will get you started...
HTH,
Andrew
On 27 Dec, 08:31, Kyle Decot <kdec...@gmail.com> wrote:
> Tags are in their own table. They are associated to the blog model via
> a HABTM relationship.
>
> On Dec 27, 2:41 am, gearvOsh <mileswjohn...@gmail.com> wrote:
>
> > How is your database setup? Are tags a column in the blog table or is
> > it its own table?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment