select(); $category=list_to_tree($list); foreach ($category as $k => $v) { $category[$k]['id']=$hashids->encode($v['id']); if(isset($v['children'])) foreach ($v['children'] as $k1 => $v1) { $category[$k]['children'][$k1]['id']=$hashids->encode($v1['id']); } } S('blog_category', $category); $blog_category=$category; } $this->blog_category=$blog_category; $this->display('Widget:blog_category'); } }