public function printCat($parent=0)
{
$print = "";
foreach($this->allCategories() as $category){
if($category["parent"]==$parent){
$print.='<li><a href="http://localhost:8888/catalog/'.$category['cat_url'].'" id="'.$category['id'].'" >'.$category['cat_name'].'</a>';
foreach($this->allCategories() as $sub_category){
if($sub_category["parent"]==$category['id']){
$print.="<ul>";
$print.= $this->printCat($category['id']);
$print.="</ul>";
break;
}
}
}
}
return $print;
}