0
yogi posted
Treeview in php and html , no javascript
making an tree-view but it should be without JS .without JS because i dont have more deeply knowledge of JS . so i am skipping to use part code which i dont know more deeply.
i need tree-view in PHP , want to use only PHP and HTML no JavaScript.
i tried boostrap treeview but its not javascript free
<link href="bootstrap.css" rel="stylesheet">
<script src="jquery.js"></script>
<script src="bootstrap-treeview.js"></script>
<div id="tree"></div>
<script type="text/javascript">
function getTree() {
var tree = [
{
text: "Parent 1",
nodes: [
{
text: "Child 1",
nodes: [
{
text: "Grandchild 1"
},
{
text: "Grandchild 2"
}
]
},
{
text: "Child 2"
}
]
},
{
text: "Parent 2"
},
{
text: "Parent 3"
},
{
text: "Parent 4"
},
{
text: "Parent 5"
}
];
return tree;
}
$('#tree').treeview({data: getTree()});
</script>