Good night, awake! Help out pliz :) I deduce a recursion tree:
$ul = "<ul>\n"; foreach( $tree as &$item ){ if ( $item['parent'] == 0 ) { $ul .= "<li>\n <p class = sidebar-content-title>".$item['title']."<span class='pull-right icon awe-chevron-down'></span></p> \n </li> \n"; } else { $ul .= "<li> \n <a class = sidebar-link href='".$item['title_en']."'>".$item['title']."</a> \n </li> \n"; } if( ! empty($item['subitems']) ) $ul .= showTree( $item['subitems'] ); } $ul .= "</ul>"; return $ul;
Categories (class = sidebar-content-title>) are displayed as follows, and for sub-categories (class = sidebar-link), the class it assigns it to% disappears during the output, and "\ n" does not tolerate lines ... what a crap so