function getFilhosTopico($Topico, $array) { echo "<ul class='table-bordered'>"; echo "<li><button name='selecao' value='" . $Topico["@Ontology#id"] . "' type='submit'>" . $Topico["@Ontology#label"] . "-" . $Topico["@Ontology#id"] . "</li></button><br>"; foreach ($array as $atual) { if ($atual["@Ontology#parent"] == $Topico["@Ontology#id"]) { // echo "<li>".($atual["@Ontology#label"])."-".($atual["@Ontology#id"])."</li><br>"; getFilhosTopico($atual, $array); } } echo "</ul>"; }
<h1> Gestor de Recursos Educacionais</h1> <div class="col-lg-8"> <h2>Tree View</h2> <div class="list-group"> <form action="topicoatual.php" method="get"> <input type="hidden" name="modelo" value="<?php echo $modeloatual; ?> "> <?php $pai = getPaideTodos($json); // echo $pai["@Ontology#label"]; getFilhosTopico($pai, $json); ?> </form> </div> </div> <div class="col-lg-4"> <a href="javascript:history.go(-1)" ><button class="btn btn-primary espacado"> Voltar para Modelos do Domínio</button></a> </div> </div> </body> </html>