This is my first PHP class, so please do not be too hard!
In addition, I know something similar already exists in this repository, but
I think that my class can be useful too, at least to examine the way I built it.
This is a very simple Tree class, it does not allow to navigate (it is not a kind of
Windows Explorer Tree!).
It can be useful to represent every kind of hierarchical data (i.e. an Organizational Chart).
The only limit I have not been able to eliminate is that every node name must be unique,
then it seems to work quite well.
If you do not like the way the Tree is displayed, you can easily change it by altering
the last piece of code of the drawTree() method.
You can use this class or alter it.
If you extend it or if you find any error, please contact me.
Thank you for your attention.
Bye :o) |