User Tools

Site Tools


bigace:developer:code_snippets:category_tree

Categories

To read the children of the Category with ID X, you would do something like:

import('classes.category.CategoryTreeWalker');
$catWalker = new CategoryTreeWalker(X);
$a = $catWalker->count();
for($i=0; $i<$a; $i++) {
  $category = $catWalker->next();
  echo 'Category Name: "' . $category->getName() . '" and ID: "'.$category->getID().'"<br/>';
}

The returned Objects are Objects of the type 'classes.category.Category'.

bigace/developer/code_snippets/category_tree.txt · Last modified: 2007/05/19 21:35 by kevin