Nonsense not much to say, direct sticker code.
1, database
2, function
function get_str ($id = 0) {global $str; $m = m ("Category", "sp_", "DB_CONFIG1"), $result = $m->where (Array ("pid" = = $id )->select ();//The subclass of the query PID if ($result) {//If there is a subclass $str. = ' <ul> '; foreach ($result as $row) {$str. = "<li>". $ row[' name ']. "</li>"; Build string Get_str ($row [' id ']); Call Get_str (), pass the ID parameter in the recordset into the function, and continue querying the subordinate} $str. = ' </ul> ';} return $STR;}
3, call procedure
3-1 controller inside:
function index () {$str = Get_str (); $this->assign ("str", $STR); $this->display (); }
3-2 inside the template:
<div> {$str} </div>
4, Show results
We look at the HTML code:
Infinite classification classes implement collapsible navigation instances (recommended)