Search code examples
cakephpcakephp-1.3conventions

Subcategories and Categories in CakePHP


What is the correct convention for making categories and subcategories in CakePHP?

Do you make two database table? Two models?


Solution

  • it depends on what you want to build in the longer run. If you want to have a one table setup, then checking out the tree behavior could be worthy. But if your requirements analysis turns out that categories and subcategories differ substantially, you are better off with a two table (and two models) setup imho.