Hi guys, I've been wrestling with recursion for a few days now and its driving me nuts. Maybe someone can shed some light on how to accomplish what I'm trying to do.
I have a table called "categories" that is setup to handle the hierarchy of categories for my project. For example: categories -------------------------------------- id parent_id category The goal is to be able to browse the content within a category while keeping a hierarchical structure in the url. For example: mydomain.com/browse/food/fruit/apples or mydomain.com/browse/computers/internet/programming/php/recursion Basically what google does on their directory: http://www.google.com/dirhp?hl=en I've tried using a hasMany relationship to return the hierarchy but it never quite works correctly. I've changed the value of $recursive and it never quite gets it right. Here's my code with the result of recursive 1 - 4: http://www.six-twentyone.com/cake/ If you go to the link above, you'll see that $recursive = 2 seems to work the best but it misses the "actionscript" category underneath the "flash" category. $recursive = 3 will catch the "actionscript" category but miss the PHP category and so on... I'd appreciate any help or ideas... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~----------~----~----~----~------~----~------~--~---
